diff --git a/configs/BUILD b/configs/BUILD index 7596ba2b41df1..9846609607e9e 100644 --- a/configs/BUILD +++ b/configs/BUILD @@ -29,19 +29,10 @@ filegroup( }), ) -genrule( - name = "v1_upgraded_configs", - srcs = ["google_com_proxy.yaml"], - outs = ["google_com_proxy.v2.upgraded.json"], - cmd = "$(location //tools:v1_to_bootstrap) $(location google_com_proxy.yaml) > $@", - tools = ["//tools:v1_to_bootstrap"], -) - genrule( name = "example_configs", srcs = [ ":configs", - ":v1_upgraded_configs", "//examples:configs", "//test/config/integration/certs", ], diff --git a/configs/configgen.sh b/configs/configgen.sh index 2ecf6b77ba06d..2e82ebff3dd98 100755 --- a/configs/configgen.sh +++ b/configs/configgen.sh @@ -25,4 +25,4 @@ for FILE in $*; do done # tar is having issues with -C for some reason so just cd into OUT_DIR. -(cd "$OUT_DIR"; tar -hcvf example_configs.tar *.json *.yaml certs/*.pem) +(cd "$OUT_DIR"; tar -hcvf example_configs.tar *.yaml certs/*.pem) diff --git a/configs/google_com_proxy.json b/configs/google_com_proxy.json deleted file mode 100644 index 6e131e1e1e543..0000000000000 --- a/configs/google_com_proxy.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "listeners": [{ - "address": "tcp://127.0.0.1:10000", - "filters": [{ - "name": "http_connection_manager", - "config": { - "codec_type": "auto", - "stat_prefix": "ingress_http", - "route_config": { - "virtual_hosts": [{ - "name": "local_service", - "domains": [ - "*" - ], - "routes": [{ - "timeout_ms": 0, - "prefix": "/", - "host_rewrite": "www.google.com", - "cluster": "service_google" - }] - }] - }, - "filters": [{ - "name": "router", - "config": {} - }] - } - }] - }], - "admin": { - "access_log_path": "/tmp/admin_access.log", - "address": "tcp://127.0.0.1:9901" - }, - "cluster_manager": { - "clusters": [{ - "name": "service_google", - "connect_timeout_ms": 250, - "type": "logical_dns", - "lb_type": "round_robin", - "hosts": [{ - "url": "tcp://google.com:443" - }], - "ssl_context": { - "sni": "www.google.com" - } - }] - } -} diff --git a/configs/google_com_proxy.yaml b/configs/google_com_proxy.yaml deleted file mode 100644 index 8683e9e4c9254..0000000000000 --- a/configs/google_com_proxy.yaml +++ /dev/null @@ -1,31 +0,0 @@ -listeners: -- address: tcp://127.0.0.1:10000 - filters: - - name: http_connection_manager - config: - codec_type: auto - stat_prefix: ingress_http - route_config: - virtual_hosts: - - name: local_service - domains: ["*"] - routes: - - prefix: "/" - timeout_ms: 0 - host_rewrite: www.google.com - cluster: service_google - filters: - - { name: router, config: {} } - -admin: - access_log_path: /tmp/admin_access.log - address: tcp://127.0.0.1:9901 - -cluster_manager: - clusters: - - name: service_google - connect_timeout_ms: 250 - type: logical_dns - lb_type: round_robin - hosts: [{ url: tcp://google.com:443 }] - ssl_context: { sni: www.google.com } diff --git a/docs/root/configuration/overview/v2_overview.rst b/docs/root/configuration/overview/v2_overview.rst index c296684d1099a..6066f0d359331 100644 --- a/docs/root/configuration/overview/v2_overview.rst +++ b/docs/root/configuration/overview/v2_overview.rst @@ -332,17 +332,6 @@ The management server could respond to EDS requests with: address: 127.0.0.2 port_value: 1234 -Upgrading from v1 configuration -------------------------------- - -While new v2 bootstrap JSON/YAML can be written, it might be expedient to upgrade an existing -v1 JSON/YAML configuration to v2. To do this (in an Envoy source tree), -you can run: - -.. code-block:: console - - bazel run //tools:v1_to_bootstrap - .. _config_overview_v2_management_server: Management server diff --git a/test/config_test/example_configs_test.cc b/test/config_test/example_configs_test.cc index ca85b6f1ecad2..6da6d5e55f0af 100644 --- a/test/config_test/example_configs_test.cc +++ b/test/config_test/example_configs_test.cc @@ -17,9 +17,9 @@ TEST(ExampleConfigsTest, All) { #ifdef __APPLE__ // freebind/freebind.yaml is not supported on macOS and disabled via Bazel. - EXPECT_EQ(21UL, ConfigTest::run(directory)); + EXPECT_EQ(20UL, ConfigTest::run(directory)); #else - EXPECT_EQ(22UL, ConfigTest::run(directory)); + EXPECT_EQ(21UL, ConfigTest::run(directory)); #endif ConfigTest::testMerge(); diff --git a/tools/BUILD b/tools/BUILD index ab8452c075a78..7d2786840b774 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -36,17 +36,3 @@ envoy_cc_binary( "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", ] + envoy_cc_platform_dep("//source/exe:platform_impl_lib"), ) - -envoy_cc_binary( - name = "v1_to_bootstrap", - srcs = ["v1_to_bootstrap.cc"], - deps = [ - "//source/common/api:api_lib", - "//source/common/config:bootstrap_json_lib", - "//source/common/json:json_loader_lib", - "//source/common/protobuf:utility_lib", - "//source/common/stats:isolated_store_lib", - "//source/common/stats:stats_options_lib", - "@envoy_api//envoy/config/bootstrap/v2:bootstrap_cc", - ] + envoy_cc_platform_dep("//source/exe:platform_impl_lib"), -) diff --git a/tools/cppcheck_wrapper.sh b/tools/cppcheck_wrapper.sh new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/tools/envoy_collect/envoy_collect.py b/tools/envoy_collect/envoy_collect.py index 78841d93a8972..c22a526a37b78 100755 --- a/tools/envoy_collect/envoy_collect.py +++ b/tools/envoy_collect/envoy_collect.py @@ -4,7 +4,7 @@ Example use: ./tools/envoy_collect.py --output-path=./envoy.tar -c - ./configs/google_com_proxy.json --service-node foo + ./configs/google_com_proxy.v2.yaml --service-node foo tar -tvf ./envoy.tar -rw------- htuch/eng 0 2017-08-13 21:13 access_0.log diff --git a/tools/v1_to_bootstrap.cc b/tools/v1_to_bootstrap.cc deleted file mode 100644 index a4d261f5a7009..0000000000000 --- a/tools/v1_to_bootstrap.cc +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Utility to convert v1 JSON configuration file to v2 bootstrap JSON (on stdout). - * - * Usage: - * - * v1_to_bootstrap - */ -#include - -#include "envoy/config/bootstrap/v2/bootstrap.pb.h" -#include "envoy/config/bootstrap/v2/bootstrap.pb.validate.h" - -#include "common/api/api_impl.h" -#include "common/config/bootstrap_json.h" -#include "common/event/real_time_system.h" -#include "common/json/json_loader.h" -#include "common/protobuf/utility.h" -#include "common/stats/isolated_store_impl.h" -#include "common/stats/stats_options_impl.h" - -#include "exe/platform_impl.h" - -// NOLINT(namespace-envoy) -int main(int argc, char** argv) { - if (argc != 2) { - std::cerr << "Usage: " << argv[0] << " " << std::endl; - return EXIT_FAILURE; - } - - Envoy::PlatformImpl platform_impl_; - Envoy::Stats::IsolatedStoreImpl stats_store; - Envoy::Event::RealTimeSystem time_system; // NO_CHECK_FORMAT(real_time) - Envoy::Api::Impl api(platform_impl_.threadFactory(), stats_store, time_system, - platform_impl_.fileSystem()); - - envoy::config::bootstrap::v2::Bootstrap bootstrap; - auto config_json = Envoy::Json::Factory::loadFromFile(argv[1], api); - Envoy::Stats::StatsOptionsImpl stats_options; - Envoy::Config::BootstrapJson::translateBootstrap(*config_json, bootstrap, stats_options); - Envoy::MessageUtil::validate(bootstrap); - std::cout << Envoy::MessageUtil::getJsonStringFromMessage(bootstrap, true); - - return EXIT_SUCCESS; -}