Skip to content

Commit

Permalink
code: use source/common/protobuf/protobuf.h
Browse files Browse the repository at this point in the history
To prevent upstream Envoy lint issues, this commit refactors the includes
to use `source/common/protobuf/protobuf.h` instead of the `google/protobuf/...`
includes.

Signed-off-by: Marco Hofstetter <[email protected]>
  • Loading branch information
mhofstetter committed Jan 7, 2025
1 parent e1a2cbf commit c61ff77
Show file tree
Hide file tree
Showing 21 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion cilium/accesslog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include "source/common/common/lock_guard.h"
#include "source/common/common/logger.h"
#include "source/common/common/thread.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"

#include "absl/strings/numbers.h"
#include "absl/strings/string_view.h"
#include "cilium/api/accesslog.pb.h"
#include "cilium/uds_client.h"
#include "google/protobuf/struct.pb.h"

namespace Envoy {
namespace Cilium {
Expand Down
2 changes: 1 addition & 1 deletion cilium/accesslog.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#include "envoy/stream_info/stream_info.h"

#include "source/common/common/thread.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep

#include "absl/base/thread_annotations.h"
#include "absl/strings/string_view.h"
#include "cilium/api/accesslog.pb.h"
#include "cilium/uds_client.h"
#include "google/protobuf/struct.pb.h"

namespace Envoy {
namespace Cilium {
Expand Down
3 changes: 1 addition & 2 deletions cilium/bpf_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "source/common/network/address_impl.h"
#include "source/common/network/upstream_socket_options_filter_state.h"
#include "source/common/network/utility.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"

#include "absl/strings/string_view.h"
Expand All @@ -43,7 +43,6 @@
#include "cilium/network_policy.h"
#include "cilium/policy_id.h"
#include "cilium/socket_option.h"
#include "google/protobuf/message.h"

namespace Envoy {
namespace Server {
Expand Down
1 change: 0 additions & 1 deletion cilium/conntrack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <cstdint>
#include <memory>
#include <mutex>
#include <string>
#include <utility>

Expand Down
1 change: 0 additions & 1 deletion cilium/conntrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <cstdint>
#include <functional>
#include <memory>
#include <mutex>
#include <string>

#include "envoy/network/address.h"
Expand Down
3 changes: 1 addition & 2 deletions cilium/grpc_subscription.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "source/common/common/backoff_strategy.h"
#include "source/common/config/utility.h"
#include "source/common/grpc/common.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/extensions/config_subscription/grpc/grpc_mux_context.h"
#include "source/extensions/config_subscription/grpc/grpc_subscription_impl.h"

Expand All @@ -32,8 +33,6 @@
#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/repeated_ptr_field.h"

namespace Envoy {
namespace Cilium {
Expand Down
2 changes: 1 addition & 1 deletion cilium/health_check_sink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include "source/common/common/lock_guard.h"
#include "source/common/common/logger.h"
#include "source/common/common/thread.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"

#include "cilium/api/health_check_sink.pb.h"
#include "cilium/uds_client.h"
#include "google/protobuf/any.pb.h"

namespace Envoy {
namespace Cilium {
Expand Down
3 changes: 1 addition & 2 deletions cilium/health_check_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
#include "envoy/upstream/health_check_event_sink.h"

#include "source/common/common/thread.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep

#include "absl/base/thread_annotations.h"
#include "cilium/api/health_check_sink.pb.h"
#include "cilium/api/health_check_sink.pb.validate.h" // IWYU pragma: keep
#include "cilium/uds_client.h"
#include "google/protobuf/any.pb.h"

namespace Envoy {
namespace Cilium {
Expand Down
4 changes: 1 addition & 3 deletions cilium/host_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "source/common/common/macros.h"
#include "source/common/network/utility.h"
#include "source/common/protobuf/message_validator_impl.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"

#include "absl/container/flat_hash_map.h"
Expand All @@ -36,8 +36,6 @@
#include "cilium/api/nphds.pb.h"
#include "cilium/api/nphds.pb.validate.h" // IWYU pragma: keep
#include "cilium/policy_id.h"
#include "google/protobuf/any.pb.h"
#include "google/protobuf/repeated_ptr_field.h"

// std::hash specialization for Abseil uint128, needed for unordered_map key.
namespace std {
Expand Down
3 changes: 1 addition & 2 deletions cilium/network_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "source/common/common/logger.h"
#include "source/common/network/upstream_server_name.h"
#include "source/common/network/upstream_subject_alt_names.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"

#include "absl/status/statusor.h"
Expand All @@ -32,7 +32,6 @@
#include "cilium/api/network_filter.pb.validate.h" // IWYU pragma: keep
#include "cilium/proxylib.h"
#include "cilium/socket_option.h"
#include "google/protobuf/message.h"
#include "proxylib/types.h"

namespace Envoy {
Expand Down
4 changes: 1 addition & 3 deletions cilium/network_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "source/common/init/target_impl.h"
#include "source/common/init/watcher_impl.h"
#include "source/common/network/utility.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"
#include "source/common/stats/timespan_impl.h"
#include "source/extensions/config_subscription/grpc/grpc_subscription_impl.h"
Expand All @@ -55,8 +55,6 @@
#include "cilium/grpc_subscription.h"
#include "cilium/ipcache.h"
#include "cilium/secret_watcher.h"
#include "google/protobuf/repeated_ptr_field.h"
#include "google/protobuf/util/message_differencer.h"

namespace Envoy {
namespace Cilium {
Expand Down
4 changes: 1 addition & 3 deletions cilium/network_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "source/common/init/target_impl.h"
#include "source/common/init/watcher_impl.h"
#include "source/common/protobuf/message_validator_impl.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"
#include "source/server/transport_socket_config_impl.h"

Expand All @@ -51,8 +51,6 @@
#include "cilium/api/npds.pb.h"
#include "cilium/api/npds.pb.validate.h" // IWYU pragma: keep
#include "cilium/conntrack.h"
#include "google/protobuf/any.pb.h"
#include "google/protobuf/repeated_ptr_field.h"

namespace Envoy {
namespace Cilium {
Expand Down
2 changes: 1 addition & 1 deletion cilium/proxylib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

#include "source/common/common/assert.h"
#include "source/common/common/logger.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep

#include "absl/container/fixed_array.h"
#include "google/protobuf/map.h"
#include "proxylib/types.h"

namespace Envoy {
Expand Down
2 changes: 1 addition & 1 deletion cilium/tls_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "source/common/common/logger.h"
#include "source/common/network/raw_buffer_socket.h"
#include "source/common/network/transport_socket_options_impl.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/tls/ssl_socket.h"

#include "absl/status/statusor.h"
Expand Down
3 changes: 1 addition & 2 deletions cilium/tls_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
#include "envoy/server/transport_socket_config.h"
#include "envoy/stats/stats_macros.h" // IWYU pragma: keep

#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep

#include "absl/status/statusor.h"
#include "google/protobuf/message.h"

namespace Envoy {
namespace Cilium {
Expand Down
3 changes: 1 addition & 2 deletions cilium/websocket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "source/common/common/logger.h"
#include "source/common/http/headers.h"
#include "source/common/network/utility.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"
#include "source/common/stream_info/bool_accessor_impl.h"
#include "source/common/tcp_proxy/tcp_proxy.h"
Expand All @@ -29,7 +29,6 @@
#include "cilium/socket_option.h"
#include "cilium/websocket_codec.h"
#include "cilium/websocket_config.h"
#include "google/protobuf/message.h"

namespace Envoy {
namespace Cilium {
Expand Down
2 changes: 1 addition & 1 deletion cilium/websocket_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "source/common/common/assert.h"
#include "source/common/common/base64.h"
#include "source/common/http/request_id_extension_impl.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"

#include "absl/strings/ascii.h"
Expand All @@ -29,7 +30,6 @@
#include "cilium/api/accesslog.pb.h"
#include "cilium/api/websocket.pb.h"
#include "cilium/websocket_protocol.h"
#include "google/protobuf/duration.pb.h"

namespace Envoy {
namespace Cilium {
Expand Down
2 changes: 1 addition & 1 deletion cilium/websocket_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#include "envoy/stats/stats_macros.h" // IWYU pragma: keep

#include "source/common/common/logger.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep

#include "absl/strings/string_view.h"
#include "cilium/accesslog.h"
#include "cilium/api/accesslog.pb.h"
#include "cilium/api/websocket.pb.h"
#include "google/protobuf/duration.pb.h"

namespace Envoy {
namespace Cilium {
Expand Down
2 changes: 1 addition & 1 deletion tests/bpf_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "source/common/common/logger.h"
#include "source/common/config/utility.h"
#include "source/common/protobuf/message_validator_impl.h"
#include "source/common/protobuf/protobuf.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep
#include "source/common/protobuf/utility.h"
#include "source/extensions/config_subscription/filesystem/filesystem_subscription_impl.h"

Expand Down
3 changes: 2 additions & 1 deletion tests/cilium_http_integration.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
#include "envoy/http/header_map.h"
#include "envoy/network/address.h"

#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep

#include "test/integration/http_integration.h"
#include "test/test_common/utility.h"

#include "absl/types/optional.h"
#include "cilium/api/accesslog.pb.h"
#include "google/protobuf/repeated_ptr_field.h"
#include "tests/accesslog_server.h"

namespace Envoy {
Expand Down
3 changes: 1 addition & 2 deletions tests/health_check_sink_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@

#include "source/common/common/base_logger.h"
#include "source/common/common/logger.h"
#include "source/common/protobuf/protobuf.h" // IWYU pragma: keep

#include "test/mocks/server/admin.h"
#include "test/mocks/server/health_checker_factory_context.h"
#include "test/test_common/utility.h"

#include "cilium/api/health_check_sink.pb.h"
#include "cilium/api/health_check_sink.pb.validate.h" // IWYU pragma: keep
#include "google/protobuf/any.pb.h"
#include "google/protobuf/util/message_differencer.h"
#include "gtest/gtest.h"
#include "tests/health_check_sink_server.h"

Expand Down

0 comments on commit c61ff77

Please sign in to comment.