diff --git a/test/integration/connect/envoy/case-centralconf/config_entries.hcl b/test/integration/connect/envoy/case-centralconf/config_entries.hcl deleted file mode 100644 index 993ad5ecb..000000000 --- a/test/integration/connect/envoy/case-centralconf/config_entries.hcl +++ /dev/null @@ -1,19 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - config { - envoy_prometheus_bind_addr = "0.0.0.0:1234" - } - } - bootstrap { - kind = "service-defaults" - name = "s1" - protocol = "http" - } - bootstrap { - kind = "service-defaults" - name = "s2" - protocol = "http" - } -} diff --git a/test/integration/connect/envoy/case-centralconf/setup.sh b/test/integration/connect/envoy/case-centralconf/setup.sh index dce23006b..f0c2593f7 100644 --- a/test/integration/connect/envoy/case-centralconf/setup.sh +++ b/test/integration/connect/envoy/case-centralconf/setup.sh @@ -2,12 +2,28 @@ set -eEuo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-defaults s1 -wait_for_config_entry service-defaults s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + envoy_prometheus_bind_addr = "0.0.0.0:1234" +} +' + +upsert_config_entry primary ' +kind = "service-defaults" +name = "s1" +protocol = "http" +' + +upsert_config_entry primary ' +kind = "service-defaults" +name = "s2" +protocol = "http" +' register_services primary gen_envoy_bootstrap s1 19000 primary gen_envoy_bootstrap s2 19001 primary + diff --git a/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/alpha/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/alpha/config_entries.hcl deleted file mode 100644 index e1f117888..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/alpha/config_entries.hcl +++ /dev/null @@ -1,26 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s2" - consumers = [ - { - peer = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/alpha/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/alpha/setup.sh index 820506ea9..46ec303e2 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/alpha/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/alpha/setup.sh @@ -2,10 +2,29 @@ set -euo pipefail +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s2" + consumers = [ + { + peer = "alpha-to-primary" + } + ] + } +] +' + register_services alpha gen_envoy_bootstrap s2 19002 alpha gen_envoy_bootstrap mesh-gateway 19003 alpha true - -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry exported-services default alpha diff --git a/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/primary/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/primary/config_entries.hcl deleted file mode 100644 index 65163b111..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/primary/config_entries.hcl +++ /dev/null @@ -1,31 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - failover = { - "*" = { - targets = [{peer = "primary-to-alpha"}] - } - } - } - - bootstrap { - kind = "service-resolver" - name = "virtual-s2" - - redirect = { - service = "s2" - peer = "primary-to-alpha" - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/primary/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/primary/setup.sh index c65cc31e4..db5571d0c 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/primary/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-cluster-peering-failover/primary/setup.sh @@ -2,9 +2,34 @@ set -euo pipefail +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +failover = { + "*" = { + targets = [{ peer = "primary-to-alpha" }] + } +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "virtual-s2" +redirect = { + service = "s2" + peer = "primary-to-alpha" +} +' + register_services primary gen_envoy_bootstrap s1 19000 primary gen_envoy_bootstrap s2 19001 primary - -wait_for_config_entry proxy-defaults global diff --git a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-none/primary/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-none/primary/config_entries.hcl deleted file mode 100644 index 55441ae3d..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-none/primary/config_entries.hcl +++ /dev/null @@ -1,23 +0,0 @@ -config_entries { - bootstrap { - kind = "service-defaults" - name = "s2" - - protocol = "http" - - mesh_gateway { - mode = "none" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - failover = { - "*" = { - datacenters = ["secondary"] - } - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-none/primary/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-none/primary/setup.sh index c6380b061..f5734d4b7 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-none/primary/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-none/primary/setup.sh @@ -2,9 +2,24 @@ set -eEuo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry service-defaults s2 -wait_for_config_entry service-resolver s2 +upsert_config_entry primary ' +kind = "service-defaults" +name = "s2" +protocol = "http" +mesh_gateway { + mode = "none" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +failover = { + "*" = { + datacenters = ["secondary"] + } +} +' # also wait for replication to make it to the remote dc wait_for_config_entry service-defaults s2 secondary diff --git a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/config_entries.hcl deleted file mode 100644 index 2a4d06ce3..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/config_entries.hcl +++ /dev/null @@ -1,23 +0,0 @@ -config_entries { - bootstrap { - kind = "service-defaults" - name = "s2" - - protocol = "http" - - mesh_gateway { - mode = "remote" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - failover = { - "*" = { - datacenters = ["secondary"] - } - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/setup.sh index c6380b061..ccd9a81a8 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/setup.sh @@ -2,9 +2,24 @@ set -eEuo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry service-defaults s2 -wait_for_config_entry service-resolver s2 +upsert_config_entry primary ' +kind = "service-defaults" +name = "s2" +protocol = "http" +mesh_gateway { + mode = "remote" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +failover = { + "*" = { + datacenters = ["secondary"] + } +} +' # also wait for replication to make it to the remote dc wait_for_config_entry service-defaults s2 secondary diff --git a/test/integration/connect/envoy/case-cfg-resolver-defaultsubset/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-defaultsubset/config_entries.hcl deleted file mode 100644 index 80c648967..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-defaultsubset/config_entries.hcl +++ /dev/null @@ -1,26 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - default_subset = "v2" - - subsets = { - "v1" = { - filter = "Service.Meta.version == v1" - } - - "v2" = { - filter = "Service.Meta.version == v2" - } - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-defaultsubset/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-defaultsubset/setup.sh index 519bba361..2dfca49e9 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-defaultsubset/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-defaultsubset/setup.sh @@ -2,9 +2,27 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +default_subset = "v2" +subsets = { + "v1" = { + filter = "Service.Meta.version == v1" + } + "v2" = { + filter = "Service.Meta.version == v2" + } +} +' register_services primary diff --git a/test/integration/connect/envoy/case-cfg-resolver-features/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-features/config_entries.hcl deleted file mode 100644 index 17a3002ec..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-features/config_entries.hcl +++ /dev/null @@ -1,27 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - default_subset = "v2" - connect_timeout = "30s" - - subsets = { - "v1" = { - filter = "Service.Meta.version == v1" - } - - "v2" = { - filter = "Service.Meta.version == v2" - } - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-features/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-features/setup.sh index 519bba361..2695c0621 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-features/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-features/setup.sh @@ -2,9 +2,28 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +default_subset = "v2" +connect_timeout = "30s" +subsets = { + "v1" = { + filter = "Service.Meta.version == v1" + } + "v2" = { + filter = "Service.Meta.version == v2" + } +} +' register_services primary diff --git a/test/integration/connect/envoy/case-cfg-resolver-subset-onlypassing/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-subset-onlypassing/config_entries.hcl deleted file mode 100644 index e4b047726..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-subset-onlypassing/config_entries.hcl +++ /dev/null @@ -1,23 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - default_subset = "test" - - subsets = { - "test" = { - only_passing = true - } - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-subset-onlypassing/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-subset-onlypassing/setup.sh index c15ca43cc..902dfeeb6 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-subset-onlypassing/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-subset-onlypassing/setup.sh @@ -2,6 +2,25 @@ set -euo pipefail +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +default_subset = "test" +subsets = { + "test" = { + only_passing = true + } +} +' + register_services primary # wait for service registration @@ -12,10 +31,6 @@ wait_for_agent_service_register s2-v1 # force s2-v1 into a warning state set_ttl_check_state service:s2-v1 warn -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 - gen_envoy_bootstrap s1 19000 gen_envoy_bootstrap s2 19001 gen_envoy_bootstrap s2-v1 19002 diff --git a/test/integration/connect/envoy/case-cfg-resolver-subset-redirect/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-subset-redirect/config_entries.hcl deleted file mode 100644 index d7226df6e..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-subset-redirect/config_entries.hcl +++ /dev/null @@ -1,35 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s3" - - subsets = { - "v1" = { - filter = "Service.Meta.version == v1" - } - - "v2" = { - filter = "Service.Meta.version == v2" - } - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - redirect { - service = "s3" - service_subset = "v2" - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-subset-redirect/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-subset-redirect/setup.sh index 606d5a791..ba7ee3bb6 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-subset-redirect/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-subset-redirect/setup.sh @@ -2,10 +2,35 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 -wait_for_config_entry service-resolver s3 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s3" +subsets = { + "v1" = { + filter = "Service.Meta.version == v1" + } + "v2" = { + filter = "Service.Meta.version == v2" + } +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +redirect { + service = "s3" + service_subset = "v2" +} +' register_services primary diff --git a/test/integration/connect/envoy/case-cfg-resolver-svc-failover/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-svc-failover/config_entries.hcl deleted file mode 100644 index 56972b392..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-svc-failover/config_entries.hcl +++ /dev/null @@ -1,37 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s3" - - subsets = { - "v1" = { - filter = "Service.Meta.version == v1" - } - - "v2" = { - filter = "Service.Meta.version == v2" - } - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - failover = { - "*" = { - service = "s3" - service_subset = "v1" - } - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-svc-failover/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-svc-failover/setup.sh index 606d5a791..953919d10 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-svc-failover/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-svc-failover/setup.sh @@ -2,10 +2,37 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 -wait_for_config_entry service-resolver s3 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s3" +subsets = { + "v1" = { + filter = "Service.Meta.version == v1" + } + "v2" = { + filter = "Service.Meta.version == v2" + } +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +failover = { + "*" = { + service = "s3" + service_subset = "v1" + } +} +' register_services primary diff --git a/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-http/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-http/config_entries.hcl deleted file mode 100644 index 549db0c60..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-http/config_entries.hcl +++ /dev/null @@ -1,19 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - redirect { - service = "s3" - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-http/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-http/setup.sh index ceae3b110..87bc93016 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-http/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-http/setup.sh @@ -2,9 +2,21 @@ set -eEuo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +redirect { + service = "s3" +} +' register_services primary diff --git a/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-tcp/config_entries.hcl b/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-tcp/config_entries.hcl deleted file mode 100644 index 4cc1777ab..000000000 --- a/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-tcp/config_entries.hcl +++ /dev/null @@ -1,19 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - redirect { - service = "s3" - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-tcp/setup.sh b/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-tcp/setup.sh index ceae3b110..4d13925e2 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-tcp/setup.sh +++ b/test/integration/connect/envoy/case-cfg-resolver-svc-redirect-tcp/setup.sh @@ -2,9 +2,21 @@ set -eEuo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +redirect { + service = "s3" +} +' register_services primary diff --git a/test/integration/connect/envoy/case-cfg-router-features/config_entries.hcl b/test/integration/connect/envoy/case-cfg-router-features/config_entries.hcl deleted file mode 100644 index 800988207..000000000 --- a/test/integration/connect/envoy/case-cfg-router-features/config_entries.hcl +++ /dev/null @@ -1,327 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - default_subset = "v1" - - subsets = { - "v1" = { - filter = "Service.Meta.version == v1" - } - - "v2" = { - filter = "Service.Meta.version == v2" - } - } - } - - bootstrap { - kind = "service-router" - name = "s2" - - routes = [ - { - match { http { path_exact = "/exact/debug" } } - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { path_exact = "/exact-alt/debug" } } - destination { - service_subset = "v1" - prefix_rewrite = "/debug" - } - }, - { - match { http { path_prefix = "/prefix/" } } - destination { - service_subset = "v2" - prefix_rewrite = "/" - } - }, - { - match { http { path_prefix = "/prefix-alt/" } } - destination { - service_subset = "v1" - prefix_rewrite = "/" - } - }, - { - match { http { - path_regex = "/deb[ug]{2}" - header = [{ - name = "x-test-debug" - exact = "regex-path" - }] - } } - destination { - service_subset = "v2" - retry_on_connect_failure = true # TODO: test - retry_on = ["reset"] # TODO: test - retry_on_status_codes = [500, 512] # TODO: test - } - }, - { - match { http { - path_exact = "/hdr-present/debug" - header = [ - { - name = "x-test-debug" - present = true - }, - ] - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-present/debug" - header = [ - { - name = "x-test-debug" - present = true - invert = true - }, - ] - } }, - destination { - service_subset = "v1" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-exact/debug" - header = [ - { - name = "x-test-debug" - exact = "exact" - }, - ] - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-exact/debug" - header = [ - { - name = "x-test-debug" - exact = "exact-alt" - }, - ] - } }, - destination { - service_subset = "v1" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-prefix/debug" - header = [ - { - name = "x-test-debug" - prefix = "prefi" - }, - ] } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-prefix/debug" - header = [ - { - name = "x-test-debug" - prefix = "alt-prefi" - }, - ] } }, - destination { - service_subset = "v1" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-suffix/debug" - header = [ - { - name = "x-test-debug" - suffix = "uffix" - }, - ] - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-suffix/debug" - header = [ - { - name = "x-test-debug" - suffix = "uffix-alt" - }, - ] - } }, - destination { - service_subset = "v1" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-regex/debug" - header = [ - { - name = "x-test-debug" - regex = "reg[ex]{2}" - }, - ] - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-regex/debug" - header = [ - { - name = "x-test-debug" - regex = "reg[ex]{3}" - }, - ] - } }, - destination { - service_subset = "v1" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/hdr-invert/debug" - header = [ - { - name = "x-test-debug" - exact = "not-this" - invert = true - }, - ], - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/qp-present/debug" - query_param = [ - { - name = "env" - present = true - }, - ], - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/qp-exact/debug" - query_param = [ - { - name = "env" - exact = "dump" - }, - ], - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/qp-regex/debug" - query_param = [ - { - name = "env" - regex = "du[mp]{2}" - }, - ], - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/method-match/debug" - methods = ["GET", "PUT"] - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - } - }, - { - match { http { - path_exact = "/header-manip/debug" - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/debug" - request_headers { - set { - x-foo = "request-bar" - } - remove = ["x-bad-req"] - } - } - }, - { - match { http { - path_exact = "/header-manip/echo" - } }, - destination { - service_subset = "v2" - prefix_rewrite = "/" - response_headers { - add { - x-foo = "response-bar" - } - remove = ["x-bad-resp"] - } - } - }, - ] - } -} diff --git a/test/integration/connect/envoy/case-cfg-router-features/setup.sh b/test/integration/connect/envoy/case-cfg-router-features/setup.sh index 0319800fc..f4b559c14 100644 --- a/test/integration/connect/envoy/case-cfg-router-features/setup.sh +++ b/test/integration/connect/envoy/case-cfg-router-features/setup.sh @@ -2,10 +2,327 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 -wait_for_config_entry service-router s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +default_subset = "v1" +subsets = { + "v1" = { + filter = "Service.Meta.version == v1" + } + "v2" = { + filter = "Service.Meta.version == v2" + } +} +' + +upsert_config_entry primary ' +kind = "service-router" +name = "s2" +routes = [ + { + match { http { path_exact = "/exact/debug" } } + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { path_exact = "/exact-alt/debug" } } + destination { + service_subset = "v1" + prefix_rewrite = "/debug" + } + }, + { + match { http { path_prefix = "/prefix/" } } + destination { + service_subset = "v2" + prefix_rewrite = "/" + } + }, + { + match { http { path_prefix = "/prefix-alt/" } } + destination { + service_subset = "v1" + prefix_rewrite = "/" + } + }, + { + match { http { + path_regex = "/deb[ug]{2}" + header = [{ + name = "x-test-debug" + exact = "regex-path" + }] + } } + destination { + service_subset = "v2" + retry_on_connect_failure = true # TODO: test + retry_on = ["reset"] # TODO: test + retry_on_status_codes = [500, 512] # TODO: test + } + }, + { + match { http { + path_exact = "/hdr-present/debug" + header = [ + { + name = "x-test-debug" + present = true + }, + ] + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-present/debug" + header = [ + { + name = "x-test-debug" + present = true + invert = true + }, + ] + } }, + destination { + service_subset = "v1" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-exact/debug" + header = [ + { + name = "x-test-debug" + exact = "exact" + }, + ] + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-exact/debug" + header = [ + { + name = "x-test-debug" + exact = "exact-alt" + }, + ] + } }, + destination { + service_subset = "v1" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-prefix/debug" + header = [ + { + name = "x-test-debug" + prefix = "prefi" + }, + ] } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-prefix/debug" + header = [ + { + name = "x-test-debug" + prefix = "alt-prefi" + }, + ] } }, + destination { + service_subset = "v1" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-suffix/debug" + header = [ + { + name = "x-test-debug" + suffix = "uffix" + }, + ] + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-suffix/debug" + header = [ + { + name = "x-test-debug" + suffix = "uffix-alt" + }, + ] + } }, + destination { + service_subset = "v1" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-regex/debug" + header = [ + { + name = "x-test-debug" + regex = "reg[ex]{2}" + }, + ] + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-regex/debug" + header = [ + { + name = "x-test-debug" + regex = "reg[ex]{3}" + }, + ] + } }, + destination { + service_subset = "v1" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/hdr-invert/debug" + header = [ + { + name = "x-test-debug" + exact = "not-this" + invert = true + }, + ], + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/qp-present/debug" + query_param = [ + { + name = "env" + present = true + }, + ], + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/qp-exact/debug" + query_param = [ + { + name = "env" + exact = "dump" + }, + ], + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/qp-regex/debug" + query_param = [ + { + name = "env" + regex = "du[mp]{2}" + }, + ], + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/method-match/debug" + methods = ["GET", "PUT"] + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + } + }, + { + match { http { + path_exact = "/header-manip/debug" + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/debug" + request_headers { + set { + x-foo = "request-bar" + } + remove = ["x-bad-req"] + } + } + }, + { + match { http { + path_exact = "/header-manip/echo" + } }, + destination { + service_subset = "v2" + prefix_rewrite = "/" + response_headers { + add { + x-foo = "response-bar" + } + remove = ["x-bad-resp"] + } + } + }, +] +' register_services primary diff --git a/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/alpha/config_entries.hcl b/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/alpha/config_entries.hcl deleted file mode 100644 index 64d011702..000000000 --- a/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/alpha/config_entries.hcl +++ /dev/null @@ -1,26 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s2" - consumers = [ - { - peer_name = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/alpha/setup.sh b/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/alpha/setup.sh index 820506ea9..ff7dcb811 100644 --- a/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/alpha/setup.sh +++ b/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/alpha/setup.sh @@ -2,10 +2,30 @@ set -euo pipefail +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s2" + consumers = [ + { + peer_name = "alpha-to-primary" + } + ] + } +] +' + register_services alpha gen_envoy_bootstrap s2 19002 alpha gen_envoy_bootstrap mesh-gateway 19003 alpha true - -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry exported-services default alpha diff --git a/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/primary/config_entries.hcl b/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/primary/config_entries.hcl deleted file mode 100644 index a3970b054..000000000 --- a/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/primary/config_entries.hcl +++ /dev/null @@ -1,53 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-splitter" - name = "split-s2" - splits = [ - { - Weight = 50 - Service = "local-s2" - ResponseHeaders { - Set { - "x-test-split" = "primary" - } - } - }, - { - Weight = 50 - Service = "peer-s2" - ResponseHeaders { - Set { - "x-test-split" = "alpha" - } - } - }, - ] - } - - bootstrap { - kind = "service-resolver" - name = "local-s2" - redirect = { - service = "s2" - } - } - - bootstrap { - kind = "service-resolver" - name = "peer-s2" - - redirect = { - service = "s2" - peer = "primary-to-alpha" - } - } -} diff --git a/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/primary/setup.sh b/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/primary/setup.sh index c65cc31e4..e59202e81 100644 --- a/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/primary/setup.sh +++ b/test/integration/connect/envoy/case-cfg-splitter-cluster-peering/primary/setup.sh @@ -2,9 +2,57 @@ set -euo pipefail +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-splitter" +name = "split-s2" +splits = [ + { + Weight = 50 + Service = "local-s2" + ResponseHeaders { + Set { + "x-test-split" = "primary" + } + } + }, + { + Weight = 50 + Service = "peer-s2" + ResponseHeaders { + Set { + "x-test-split" = "alpha" + } + } + }, +] +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "local-s2" +redirect = { + service = "s2" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "peer-s2" +redirect = { + service = "s2" + peer = "primary-to-alpha" +} +' + register_services primary gen_envoy_bootstrap s1 19000 primary gen_envoy_bootstrap s2 19001 primary - -wait_for_config_entry proxy-defaults global diff --git a/test/integration/connect/envoy/case-cfg-splitter-features/config_entries.hcl b/test/integration/connect/envoy/case-cfg-splitter-features/config_entries.hcl deleted file mode 100644 index 1ea93fb5f..000000000 --- a/test/integration/connect/envoy/case-cfg-splitter-features/config_entries.hcl +++ /dev/null @@ -1,65 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - subsets = { - "v1" = { - filter = "Service.Meta.version == v1" - } - - "v2" = { - filter = "Service.Meta.version == v2" - } - } - } - - bootstrap { - kind = "service-splitter" - name = "s2" - - splits = [ - { - weight = 50, - service_subset = "v2" - request_headers { - set { - x-split-leg = "v2" - } - remove = ["x-bad-req"] - } - response_headers { - add { - x-svc-version = "v2" - } - remove = ["x-bad-resp"] - } - }, - { - weight = 50, - service_subset = "v1" - request_headers { - set { - x-split-leg = "v1" - } - remove = ["x-bad-req"] - } - response_headers { - add { - x-svc-version = "v1" - } - remove = ["x-bad-resp"] - } - }, - ] - } -} diff --git a/test/integration/connect/envoy/case-cfg-splitter-features/setup.sh b/test/integration/connect/envoy/case-cfg-splitter-features/setup.sh index fe0967a38..c04afa2b6 100644 --- a/test/integration/connect/envoy/case-cfg-splitter-features/setup.sh +++ b/test/integration/connect/envoy/case-cfg-splitter-features/setup.sh @@ -2,10 +2,65 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 -wait_for_config_entry service-splitter s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +subsets = { + "v1" = { + filter = "Service.Meta.version == v1" + } + "v2" = { + filter = "Service.Meta.version == v2" + } +} +' + +upsert_config_entry primary ' +kind = "service-splitter" +name = "s2" +splits = [ + { + weight = 50, + service_subset = "v2" + request_headers { + set { + x-split-leg = "v2" + } + remove = ["x-bad-req"] + } + response_headers { + add { + x-svc-version = "v2" + } + remove = ["x-bad-resp"] + } + }, + { + weight = 50, + service_subset = "v1" + request_headers { + set { + x-split-leg = "v1" + } + remove = ["x-bad-req"] + } + response_headers { + add { + x-svc-version = "v1" + } + remove = ["x-bad-resp"] + } + }, +] +' register_services primary diff --git a/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/alpha/config_entries.hcl b/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/alpha/config_entries.hcl deleted file mode 100644 index 6c186ecae..000000000 --- a/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/alpha/config_entries.hcl +++ /dev/null @@ -1,34 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s1" - consumers = [ - { - peer_name = "alpha-to-primary" - } - ] - }, - { - name = "s2" - consumers = [ - { - peer_name = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/alpha/setup.sh b/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/alpha/setup.sh index e6d27d5d8..42177898e 100644 --- a/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/alpha/setup.sh +++ b/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/alpha/setup.sh @@ -2,8 +2,36 @@ set -euo pipefail -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry exported-services default alpha +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s1" + consumers = [ + { + peer_name = "alpha-to-primary" + } + ] + }, + { + name = "s2" + consumers = [ + { + peer_name = "alpha-to-primary" + } + ] + } +] +' register_services alpha diff --git a/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/primary/config_entries.hcl b/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/primary/config_entries.hcl deleted file mode 100644 index 0b38ad6ed..000000000 --- a/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/primary/config_entries.hcl +++ /dev/null @@ -1,88 +0,0 @@ -config_entries { - - bootstrap { - kind = "proxy-defaults" - name = "global" - config { - protocol = "http" - } - } - - bootstrap { - kind = "ingress-gateway" - name = "ingress-gateway" - listeners = [ - { - protocol = "http" - port = 9999 - services = [ - { - name = "peer-s2" - } - ] - }, - { - protocol = "http" - port = 10000 - services = [ - { - name = "peer-s1" - } - ] - }, - { - protocol = "http" - port = 10001 - services = [ - { - name = "s1" - } - ] - }, - { - protocol = "http" - port = 10002 - services = [ - { - name = "split" - } - ] - } - ] - } - - bootstrap { - kind = "service-resolver" - name = "peer-s1" - - redirect = { - service = "s1" - peer = "primary-to-alpha" - } - } - - bootstrap { - kind = "service-resolver" - name = "peer-s2" - - redirect = { - service = "s2" - peer = "primary-to-alpha" - } - } - - bootstrap { - kind = "service-splitter" - name = "split" - splits = [ - { - Weight = 50 - Service = "peer-s1" - }, - { - Weight = 50 - Service = "peer-s2" - }, - ] - } -} diff --git a/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/primary/setup.sh b/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/primary/setup.sh index b92dfc15e..54a201cad 100644 --- a/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/primary/setup.sh +++ b/test/integration/connect/envoy/case-cfg-splitter-peering-ingress-gateways/primary/setup.sh @@ -2,13 +2,91 @@ set -eEuo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry ingress-gateway ingress-gateway -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver peer-s1 -wait_for_config_entry service-resolver peer-s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +listeners = [ + { + protocol = "http" + port = 9999 + services = [ + { + name = "peer-s2" + } + ] + }, + { + protocol = "http" + port = 10000 + services = [ + { + name = "peer-s1" + } + ] + }, + { + protocol = "http" + port = 10001 + services = [ + { + name = "s1" + } + ] + }, + { + protocol = "http" + port = 10002 + services = [ + { + name = "split" + } + ] + } +] +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "peer-s1" +redirect = { + service = "s1" + peer = "primary-to-alpha" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "peer-s2" +redirect = { + service = "s2" + peer = "primary-to-alpha" +} +' + +upsert_config_entry primary ' +kind = "service-splitter" +name = "split" +splits = [ + { + Weight = 50 + Service = "peer-s1" + }, + { + Weight = 50 + Service = "peer-s2" + }, +] +' register_services primary gen_envoy_bootstrap ingress-gateway 20000 primary true -gen_envoy_bootstrap s1 19000 primary \ No newline at end of file +gen_envoy_bootstrap s1 19000 primary diff --git a/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/alpha/config_entries.hcl b/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/alpha/config_entries.hcl deleted file mode 100644 index 996df1d21..000000000 --- a/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/alpha/config_entries.hcl +++ /dev/null @@ -1,32 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - }, - { - kind = "mesh" - peering { - peer_through_mesh_gateways = true - } - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s2" - consumers = [ - { - peer = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/alpha/setup.sh b/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/alpha/setup.sh index 6d341b20a..4c6fa1594 100644 --- a/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/alpha/setup.sh +++ b/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/alpha/setup.sh @@ -2,11 +2,37 @@ set -euo pipefail +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry alpha ' +kind = "mesh" +peering { + peer_through_mesh_gateways = true +} +' + +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s2" + consumers = [ + { + peer = "alpha-to-primary" + } + ] + } +] +' + register_services alpha gen_envoy_bootstrap s2 19002 alpha gen_envoy_bootstrap mesh-gateway 19003 alpha true - -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry exported-services default alpha -wait_for_config_entry mesh mesh alpha diff --git a/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/primary/config_entries.hcl b/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/primary/config_entries.hcl deleted file mode 100644 index 6baeb569f..000000000 --- a/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/primary/config_entries.hcl +++ /dev/null @@ -1,18 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - }, - { - kind = "mesh" - peering { - peer_through_mesh_gateways = true - } - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/primary/setup.sh b/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/primary/setup.sh index 3aa37f8cb..5b0775f03 100644 --- a/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/primary/setup.sh +++ b/test/integration/connect/envoy/case-cross-peer-control-plane-mgw/primary/setup.sh @@ -2,10 +2,21 @@ set -euo pipefail +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' +upsert_config_entry primary ' +kind = "mesh" +peering { + peer_through_mesh_gateways = true +} +' + register_services primary gen_envoy_bootstrap s1 19000 primary gen_envoy_bootstrap mesh-gateway 19001 primary true - -wait_for_config_entry proxy-defaults global -wait_for_config_entry mesh mesh alpha diff --git a/test/integration/connect/envoy/case-cross-peers-http-router/alpha/config_entries.hcl b/test/integration/connect/envoy/case-cross-peers-http-router/alpha/config_entries.hcl deleted file mode 100644 index 54941a903..000000000 --- a/test/integration/connect/envoy/case-cross-peers-http-router/alpha/config_entries.hcl +++ /dev/null @@ -1,39 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - }, - { - kind = "service-router" - name = "s2" - routes = [ - { - match { http { path_prefix = "/s3/" } } - destination { - service = "s3" - prefix_rewrite = "/" - } - }, - ] - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s2" - consumers = [ - { - peer = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peers-http-router/alpha/setup.sh b/test/integration/connect/envoy/case-cross-peers-http-router/alpha/setup.sh index 75b38c6f2..d25c61e21 100644 --- a/test/integration/connect/envoy/case-cross-peers-http-router/alpha/setup.sh +++ b/test/integration/connect/envoy/case-cross-peers-http-router/alpha/setup.sh @@ -2,12 +2,45 @@ set -euo pipefail +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry alpha ' +kind = "service-router" +name = "s2" +routes = [ + { + match { http { path_prefix = "/s3/" } } + destination { + service = "s3" + prefix_rewrite = "/" + } + }, +] +' + +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s2" + consumers = [ + { + peer = "alpha-to-primary" + } + ] + } +] +' + register_services alpha gen_envoy_bootstrap s2 19002 alpha gen_envoy_bootstrap mesh-gateway 19003 alpha true gen_envoy_bootstrap s3 19004 alpha - -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry service-router s2 alpha -wait_for_config_entry exported-services default alpha diff --git a/test/integration/connect/envoy/case-cross-peers-http-router/primary/config_entries.hcl b/test/integration/connect/envoy/case-cross-peers-http-router/primary/config_entries.hcl deleted file mode 100644 index 3bba32530..000000000 --- a/test/integration/connect/envoy/case-cross-peers-http-router/primary/config_entries.hcl +++ /dev/null @@ -1,12 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peers-http-router/primary/setup.sh b/test/integration/connect/envoy/case-cross-peers-http-router/primary/setup.sh index 38122406d..ad9c9691c 100644 --- a/test/integration/connect/envoy/case-cross-peers-http-router/primary/setup.sh +++ b/test/integration/connect/envoy/case-cross-peers-http-router/primary/setup.sh @@ -2,9 +2,15 @@ set -euo pipefail +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + register_services primary gen_envoy_bootstrap s1 19000 primary gen_envoy_bootstrap mesh-gateway 19001 primary true - -wait_for_config_entry proxy-defaults global diff --git a/test/integration/connect/envoy/case-cross-peers-http/alpha/config_entries.hcl b/test/integration/connect/envoy/case-cross-peers-http/alpha/config_entries.hcl deleted file mode 100644 index a46dc7ee2..000000000 --- a/test/integration/connect/envoy/case-cross-peers-http/alpha/config_entries.hcl +++ /dev/null @@ -1,26 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s2" - consumers = [ - { - peer = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peers-http/alpha/setup.sh b/test/integration/connect/envoy/case-cross-peers-http/alpha/setup.sh index 820506ea9..2a8edf8c7 100644 --- a/test/integration/connect/envoy/case-cross-peers-http/alpha/setup.sh +++ b/test/integration/connect/envoy/case-cross-peers-http/alpha/setup.sh @@ -2,10 +2,30 @@ set -euo pipefail +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s2" + consumers = [ + { + peer = "alpha-to-primary" + } + ] + } +] +' + register_services alpha gen_envoy_bootstrap s2 19002 alpha gen_envoy_bootstrap mesh-gateway 19003 alpha true - -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry exported-services default alpha diff --git a/test/integration/connect/envoy/case-cross-peers-http/primary/config_entries.hcl b/test/integration/connect/envoy/case-cross-peers-http/primary/config_entries.hcl deleted file mode 100644 index ecb777e7f..000000000 --- a/test/integration/connect/envoy/case-cross-peers-http/primary/config_entries.hcl +++ /dev/null @@ -1,13 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - # This shouldn't affect the imported listener's protocol, which should be http. - protocol = "tcp" - } - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peers-http/primary/setup.sh b/test/integration/connect/envoy/case-cross-peers-http/primary/setup.sh index 38122406d..7f205c5e6 100644 --- a/test/integration/connect/envoy/case-cross-peers-http/primary/setup.sh +++ b/test/integration/connect/envoy/case-cross-peers-http/primary/setup.sh @@ -2,9 +2,16 @@ set -euo pipefail +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + # This should not affect the imported listener protocol, which should be http. + protocol = "tcp" +} +' + register_services primary gen_envoy_bootstrap s1 19000 primary gen_envoy_bootstrap mesh-gateway 19001 primary true - -wait_for_config_entry proxy-defaults global diff --git a/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/alpha/config_entries.hcl b/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/alpha/config_entries.hcl deleted file mode 100644 index 4356f4ba8..000000000 --- a/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/alpha/config_entries.hcl +++ /dev/null @@ -1,33 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - }, - { - kind = "service-resolver" - name = "s2" - redirect { - service = "s3" - } - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s2" - consumers = [ - { - peer = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/alpha/setup.sh b/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/alpha/setup.sh index a2645baf6..556d8fa40 100644 --- a/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/alpha/setup.sh +++ b/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/alpha/setup.sh @@ -2,12 +2,39 @@ set -euo pipefail +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry alpha ' +kind = "service-resolver" +name = "s2" +redirect { + service = "s3" +} +' + +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s2" + consumers = [ + { + peer = "alpha-to-primary" + } + ] + } +] +' + register_services alpha gen_envoy_bootstrap s2 19002 alpha gen_envoy_bootstrap mesh-gateway 19003 alpha true gen_envoy_bootstrap s3 19004 alpha - -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry service-resolver s2 alpha -wait_for_config_entry exported-services default alpha diff --git a/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/primary/config_entries.hcl b/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/primary/config_entries.hcl deleted file mode 100644 index b3a8d9171..000000000 --- a/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/primary/config_entries.hcl +++ /dev/null @@ -1,12 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/primary/setup.sh b/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/primary/setup.sh index 38122406d..8bb0836c7 100644 --- a/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/primary/setup.sh +++ b/test/integration/connect/envoy/case-cross-peers-resolver-redirect-tcp/primary/setup.sh @@ -2,9 +2,15 @@ set -euo pipefail +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + register_services primary gen_envoy_bootstrap s1 19000 primary gen_envoy_bootstrap mesh-gateway 19001 primary true - -wait_for_config_entry proxy-defaults global diff --git a/test/integration/connect/envoy/case-cross-peers/alpha/config_entries.hcl b/test/integration/connect/envoy/case-cross-peers/alpha/config_entries.hcl deleted file mode 100644 index e1f117888..000000000 --- a/test/integration/connect/envoy/case-cross-peers/alpha/config_entries.hcl +++ /dev/null @@ -1,26 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s2" - consumers = [ - { - peer = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peers/alpha/setup.sh b/test/integration/connect/envoy/case-cross-peers/alpha/setup.sh index 820506ea9..29e3c0141 100644 --- a/test/integration/connect/envoy/case-cross-peers/alpha/setup.sh +++ b/test/integration/connect/envoy/case-cross-peers/alpha/setup.sh @@ -2,10 +2,30 @@ set -euo pipefail +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s2" + consumers = [ + { + peer = "alpha-to-primary" + } + ] + } +] +' + register_services alpha gen_envoy_bootstrap s2 19002 alpha gen_envoy_bootstrap mesh-gateway 19003 alpha true - -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry exported-services default alpha diff --git a/test/integration/connect/envoy/case-cross-peers/primary/config_entries.hcl b/test/integration/connect/envoy/case-cross-peers/primary/config_entries.hcl deleted file mode 100644 index b3a8d9171..000000000 --- a/test/integration/connect/envoy/case-cross-peers/primary/config_entries.hcl +++ /dev/null @@ -1,12 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - } - ] -} diff --git a/test/integration/connect/envoy/case-cross-peers/primary/setup.sh b/test/integration/connect/envoy/case-cross-peers/primary/setup.sh index 38122406d..8bb0836c7 100644 --- a/test/integration/connect/envoy/case-cross-peers/primary/setup.sh +++ b/test/integration/connect/envoy/case-cross-peers/primary/setup.sh @@ -2,9 +2,15 @@ set -euo pipefail +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + register_services primary gen_envoy_bootstrap s1 19000 primary gen_envoy_bootstrap mesh-gateway 19001 primary true - -wait_for_config_entry proxy-defaults global diff --git a/test/integration/connect/envoy/case-ingress-gateway-grpc/config_entries.hcl b/test/integration/connect/envoy/case-ingress-gateway-grpc/config_entries.hcl deleted file mode 100644 index 1d2000940..000000000 --- a/test/integration/connect/envoy/case-ingress-gateway-grpc/config_entries.hcl +++ /dev/null @@ -1,24 +0,0 @@ -config_entries { - bootstrap { - kind = "service-defaults" - name = "s1" - protocol = "grpc" - } - bootstrap { - kind = "ingress-gateway" - name = "ingress-gateway" - - listeners = [ - { - port = 9999 - protocol = "grpc" - services = [ - { - name = "s1" - hosts = ["localhost:9999"] - } - ] - } - ] - } -} diff --git a/test/integration/connect/envoy/case-ingress-gateway-grpc/setup.sh b/test/integration/connect/envoy/case-ingress-gateway-grpc/setup.sh index 93bfefee4..3271072c4 100644 --- a/test/integration/connect/envoy/case-ingress-gateway-grpc/setup.sh +++ b/test/integration/connect/envoy/case-ingress-gateway-grpc/setup.sh @@ -2,8 +2,28 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry ingress-gateway ingress-gateway +upsert_config_entry primary ' +kind = "service-defaults" +name = "s1" +protocol = "grpc" +' + +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +listeners = [ + { + port = 9999 + protocol = "grpc" + services = [ + { + name = "s1" + hosts = ["localhost:9999"] + } + ] + } +] +' register_services primary diff --git a/test/integration/connect/envoy/case-ingress-gateway-http/config_entries.hcl b/test/integration/connect/envoy/case-ingress-gateway-http/config_entries.hcl deleted file mode 100644 index 10c939510..000000000 --- a/test/integration/connect/envoy/case-ingress-gateway-http/config_entries.hcl +++ /dev/null @@ -1,81 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - config { - protocol = "http" - } - }, - { - kind = "ingress-gateway" - name = "ingress-gateway" - - listeners = [ - { - port = 9999 - protocol = "http" - services = [ - { - name = "router" - request_headers { - add { - x-foo = "bar-req" - x-existing-1 = "appended-req" - } - set { - x-existing-2 = "replaced-req" - x-client-ip = "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%" - } - remove = ["x-bad-req"] - } - response_headers { - add { - x-foo = "bar-resp" - x-existing-1 = "appended-resp" - } - set { - x-existing-2 = "replaced-resp" - } - remove = ["x-bad-resp"] - } - } - ] - } - ] - }, - { - kind = "service-router" - // This is a "virtual" service name and will not have a backing - // service definition. It must match the name defined in the ingress - // configuration. - name = "router" - routes = [ - { - match { - http { - path_prefix = "/s1/" - } - } - - destination { - service = "s1" - prefix_rewrite = "/" - } - }, - { - match { - http { - path_prefix = "/s2/" - } - } - - destination { - service = "s2" - prefix_rewrite = "/" - } - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-ingress-gateway-http/setup.sh b/test/integration/connect/envoy/case-ingress-gateway-http/setup.sh index fd46866e4..34fa9592d 100644 --- a/test/integration/connect/envoy/case-ingress-gateway-http/setup.sh +++ b/test/integration/connect/envoy/case-ingress-gateway-http/setup.sh @@ -2,10 +2,82 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry ingress-gateway ingress-gateway -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-router router +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +listeners = [ + { + port = 9999 + protocol = "http" + services = [ + { + name = "router" + request_headers { + add { + x-foo = "bar-req" + x-existing-1 = "appended-req" + } + set { + x-existing-2 = "replaced-req" + x-client-ip = "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%" + } + remove = ["x-bad-req"] + } + response_headers { + add { + x-foo = "bar-resp" + x-existing-1 = "appended-resp" + } + set { + x-existing-2 = "replaced-resp" + } + remove = ["x-bad-resp"] + } + } + ] + } +] +' + +upsert_config_entry primary ' +kind = "service-router" +// This is a "virtual" service name and will not have a backing +// service definition. It must match the name defined in the ingress +// configuration. +name = "router" +routes = [ + { + match { + http { + path_prefix = "/s1/" + } + } + destination { + service = "s1" + prefix_rewrite = "/" + } + }, + { + match { + http { + path_prefix = "/s2/" + } + } + destination { + service = "s2" + prefix_rewrite = "/" + } + } +] +' register_services primary diff --git a/test/integration/connect/envoy/case-ingress-gateway-multiple-services/config_entries.hcl b/test/integration/connect/envoy/case-ingress-gateway-multiple-services/config_entries.hcl deleted file mode 100644 index c1c7c5832..000000000 --- a/test/integration/connect/envoy/case-ingress-gateway-multiple-services/config_entries.hcl +++ /dev/null @@ -1,45 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - config { - protocol = "http" - } - }, - { - kind = "ingress-gateway" - name = "ingress-gateway" - - Defaults { - MaxConnections = 10 - MaxPendingRequests = 20 - MaxConcurrentRequests = 30 - } - listeners = [ - { - port = 9999 - protocol = "http" - services = [ - { - name = "*" - } - ] - }, - { - port = 9998 - protocol = "http" - services = [ - { - name = "s1" - hosts = ["test.example.com"] - MaxConnections = 100 - MaxPendingRequests = 200 - MaxConcurrentRequests = 300 - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-ingress-gateway-multiple-services/setup.sh b/test/integration/connect/envoy/case-ingress-gateway-multiple-services/setup.sh index dd732cc0a..b0466de54 100644 --- a/test/integration/connect/envoy/case-ingress-gateway-multiple-services/setup.sh +++ b/test/integration/connect/envoy/case-ingress-gateway-multiple-services/setup.sh @@ -2,9 +2,47 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry ingress-gateway ingress-gateway -wait_for_config_entry proxy-defaults global +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +Defaults { + MaxConnections = 10 + MaxPendingRequests = 20 + MaxConcurrentRequests = 30 +} +listeners = [ + { + port = 9999 + protocol = "http" + services = [ + { + name = "*" + } + ] + }, + { + port = 9998 + protocol = "http" + services = [ + { + name = "s1" + hosts = ["test.example.com"] + MaxConnections = 100 + MaxPendingRequests = 200 + MaxConcurrentRequests = 300 + } + ] + } +] +' register_services primary diff --git a/test/integration/connect/envoy/case-ingress-gateway-peering-failover/alpha/config_entries.hcl b/test/integration/connect/envoy/case-ingress-gateway-peering-failover/alpha/config_entries.hcl deleted file mode 100644 index 64d011702..000000000 --- a/test/integration/connect/envoy/case-ingress-gateway-peering-failover/alpha/config_entries.hcl +++ /dev/null @@ -1,26 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - }, - { - kind = "exported-services" - name = "default" - services = [ - { - name = "s2" - consumers = [ - { - peer_name = "alpha-to-primary" - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-ingress-gateway-peering-failover/alpha/setup.sh b/test/integration/connect/envoy/case-ingress-gateway-peering-failover/alpha/setup.sh index 820506ea9..ff7dcb811 100644 --- a/test/integration/connect/envoy/case-ingress-gateway-peering-failover/alpha/setup.sh +++ b/test/integration/connect/envoy/case-ingress-gateway-peering-failover/alpha/setup.sh @@ -2,10 +2,30 @@ set -euo pipefail +upsert_config_entry alpha ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry alpha ' +kind = "exported-services" +name = "default" +services = [ + { + name = "s2" + consumers = [ + { + peer_name = "alpha-to-primary" + } + ] + } +] +' + register_services alpha gen_envoy_bootstrap s2 19002 alpha gen_envoy_bootstrap mesh-gateway 19003 alpha true - -wait_for_config_entry proxy-defaults global alpha -wait_for_config_entry exported-services default alpha diff --git a/test/integration/connect/envoy/case-ingress-gateway-peering-failover/primary/config_entries.hcl b/test/integration/connect/envoy/case-ingress-gateway-peering-failover/primary/config_entries.hcl deleted file mode 100644 index 8be1a8cca..000000000 --- a/test/integration/connect/envoy/case-ingress-gateway-peering-failover/primary/config_entries.hcl +++ /dev/null @@ -1,47 +0,0 @@ -config_entries { - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "tcp" - } - } - - bootstrap { - kind = "ingress-gateway" - name = "ingress-gateway" - listeners = [ - { - protocol = "tcp" - port = 10000 - services = [ - { - name = "s2" - } - ] - } - ] - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - failover = { - "*" = { - targets = [{peer = "primary-to-alpha"}] - } - } - } - - bootstrap { - kind = "service-resolver" - name = "virtual-s2" - - redirect = { - service = "s2" - peer = "primary-to-alpha" - } - } -} diff --git a/test/integration/connect/envoy/case-ingress-gateway-peering-failover/primary/setup.sh b/test/integration/connect/envoy/case-ingress-gateway-peering-failover/primary/setup.sh index 5577a4e8d..327bd980b 100644 --- a/test/integration/connect/envoy/case-ingress-gateway-peering-failover/primary/setup.sh +++ b/test/integration/connect/envoy/case-ingress-gateway-peering-failover/primary/setup.sh @@ -2,12 +2,50 @@ set -euo pipefail -wait_for_config_entry ingress-gateway ingress-gateway -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 -wait_for_config_entry service-resolver virtual-s2 +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "tcp" +} +' + +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +listeners = [ + { + protocol = "tcp" + port = 10000 + services = [ + { + name = "s2" + } + ] + } +] +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +failover = { + "*" = { + targets = [{ peer = "primary-to-alpha" }] + } +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "virtual-s2" +redirect = { + service = "s2" + peer = "primary-to-alpha" +} +' register_services primary gen_envoy_bootstrap ingress-gateway 20000 primary true -gen_envoy_bootstrap s2 19001 primary \ No newline at end of file +gen_envoy_bootstrap s2 19001 primary diff --git a/test/integration/connect/envoy/case-ingress-gateway-sds/config_entries.hcl b/test/integration/connect/envoy/case-ingress-gateway-sds/config_entries.hcl deleted file mode 100644 index 16db5bec9..000000000 --- a/test/integration/connect/envoy/case-ingress-gateway-sds/config_entries.hcl +++ /dev/null @@ -1,60 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - config { - protocol = "http" - } - }, - { - kind = "ingress-gateway" - name = "ingress-gateway" - - listeners = [ - { - port = 9999 - protocol = "http" - services = [ - { - name = "*" - } - ] - tls { - sds { - cluster_name = "sds-cluster" - cert_resource = "wildcard.ingress.consul" - } - } - }, - { - port = 9998 - protocol = "http" - services = [ - { - name = "s1" - hosts = ["foo.example.com"] - tls { - sds { - cluster_name = "sds-cluster" - cert_resource = "foo.example.com" - } - } - }, - { - # Route to s2 on a differet domain with different cert - name = "s2" - hosts = ["www.example.com"] - tls { - sds { - cluster_name = "sds-cluster" - cert_resource = "www.example.com" - } - } - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-ingress-gateway-sds/setup.sh b/test/integration/connect/envoy/case-ingress-gateway-sds/setup.sh index dd732cc0a..c651fdc2b 100644 --- a/test/integration/connect/envoy/case-ingress-gateway-sds/setup.sh +++ b/test/integration/connect/envoy/case-ingress-gateway-sds/setup.sh @@ -2,9 +2,62 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry ingress-gateway ingress-gateway -wait_for_config_entry proxy-defaults global +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +listeners = [ + { + port = 9999 + protocol = "http" + services = [ + { + name = "*" + } + ] + tls { + sds { + cluster_name = "sds-cluster" + cert_resource = "wildcard.ingress.consul" + } + } + }, + { + port = 9998 + protocol = "http" + services = [ + { + name = "s1" + hosts = ["foo.example.com"] + tls { + sds { + cluster_name = "sds-cluster" + cert_resource = "foo.example.com" + } + } + }, + { + # Route to s2 on a differet domain with different cert + name = "s2" + hosts = ["www.example.com"] + tls { + sds { + cluster_name = "sds-cluster" + cert_resource = "www.example.com" + } + } + } + ] + } +] +' register_services primary diff --git a/test/integration/connect/envoy/case-ingress-gateway-simple/config_entries.hcl b/test/integration/connect/envoy/case-ingress-gateway-simple/config_entries.hcl deleted file mode 100644 index 88a76594a..000000000 --- a/test/integration/connect/envoy/case-ingress-gateway-simple/config_entries.hcl +++ /dev/null @@ -1,24 +0,0 @@ -config_entries { - bootstrap { - kind = "ingress-gateway" - name = "ingress-gateway" - Defaults { - MaxConnections = 10 - MaxPendingRequests = 20 - MaxConcurrentRequests = 30 - } - listeners = [ - { - port = 9999 - protocol = "tcp" - services = [ - { - name = "s1" - MaxConnections = 100 - MaxPendingRequests = 200 - } - ] - } - ] - } -} diff --git a/test/integration/connect/envoy/case-ingress-gateway-simple/setup.sh b/test/integration/connect/envoy/case-ingress-gateway-simple/setup.sh index 93bfefee4..2c0378325 100644 --- a/test/integration/connect/envoy/case-ingress-gateway-simple/setup.sh +++ b/test/integration/connect/envoy/case-ingress-gateway-simple/setup.sh @@ -2,8 +2,28 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry ingress-gateway ingress-gateway +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +Defaults { + MaxConnections = 10 + MaxPendingRequests = 20 + MaxConcurrentRequests = 30 +} +listeners = [ + { + port = 9999 + protocol = "tcp" + services = [ + { + name = "s1" + MaxConnections = 100 + MaxPendingRequests = 200 + } + ] + } +] +' register_services primary diff --git a/test/integration/connect/envoy/case-ingress-gateway-tls/config_entries.hcl b/test/integration/connect/envoy/case-ingress-gateway-tls/config_entries.hcl deleted file mode 100644 index 66e3bf1ad..000000000 --- a/test/integration/connect/envoy/case-ingress-gateway-tls/config_entries.hcl +++ /dev/null @@ -1,41 +0,0 @@ -config_entries { - bootstrap = [ - { - kind = "proxy-defaults" - name = "global" - config { - protocol = "http" - } - }, - { - kind = "ingress-gateway" - name = "ingress-gateway" - - tls { - enabled = true - } - - listeners = [ - { - port = 9998 - protocol = "http" - services = [ - { - name = "s1" - } - ] - }, - { - port = 9999 - protocol = "http" - services = [ - { - name = "s1" - hosts = ["test.example.com"] - } - ] - } - ] - } - ] -} diff --git a/test/integration/connect/envoy/case-ingress-gateway-tls/setup.sh b/test/integration/connect/envoy/case-ingress-gateway-tls/setup.sh index 93bfefee4..b23971f0b 100644 --- a/test/integration/connect/envoy/case-ingress-gateway-tls/setup.sh +++ b/test/integration/connect/envoy/case-ingress-gateway-tls/setup.sh @@ -2,8 +2,42 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry ingress-gateway ingress-gateway +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +tls { + enabled = true +} +listeners = [ + { + port = 9998 + protocol = "http" + services = [ + { + name = "s1" + } + ] + }, + { + port = 9999 + protocol = "http" + services = [ + { + name = "s1" + hosts = ["test.example.com"] + } + ] + } +] +' register_services primary diff --git a/test/integration/connect/envoy/case-ingress-mesh-gateways-resolver/primary/config_entries.hcl b/test/integration/connect/envoy/case-ingress-mesh-gateways-resolver/primary/config_entries.hcl deleted file mode 100644 index 20d449c4e..000000000 --- a/test/integration/connect/envoy/case-ingress-mesh-gateways-resolver/primary/config_entries.hcl +++ /dev/null @@ -1,61 +0,0 @@ -config_entries { - bootstrap { - kind = "ingress-gateway" - name = "ingress-gateway" - - listeners = [ - { - protocol = "tcp" - port = 9999 - services = [ - { - name = "s2" - } - ] - }, - { - protocol = "tcp" - port = 10000 - services = [ - { - name = "s1" - } - ] - } - ] - } - - bootstrap { - kind = "proxy-defaults" - name = "global" - mesh_gateway { - mode = "local" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - redirect { - service = "s2" - datacenter = "secondary" - } - } - - bootstrap { - kind = "service-defaults" - name = "s1" - mesh_gateway { - mode = "remote" - } - } - - bootstrap { - kind = "service-resolver" - name = "s1" - redirect { - service = "s1" - datacenter = "secondary" - } - } -} diff --git a/test/integration/connect/envoy/case-ingress-mesh-gateways-resolver/primary/setup.sh b/test/integration/connect/envoy/case-ingress-mesh-gateways-resolver/primary/setup.sh index 1d8641064..d9c269b79 100644 --- a/test/integration/connect/envoy/case-ingress-mesh-gateways-resolver/primary/setup.sh +++ b/test/integration/connect/envoy/case-ingress-mesh-gateways-resolver/primary/setup.sh @@ -2,13 +2,67 @@ set -eEuo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry ingress-gateway ingress-gateway -wait_for_config_entry proxy-defaults global +upsert_config_entry primary ' +kind = "ingress-gateway" +name = "ingress-gateway" +listeners = [ + { + protocol = "tcp" + port = 9999 + services = [ + { + name = "s2" + } + ] + }, + { + protocol = "tcp" + port = 10000 + services = [ + { + name = "s1" + } + ] + } +] +' + +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +mesh_gateway { + mode = "local" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +redirect { + service = "s2" + datacenter = "secondary" +} +' + +upsert_config_entry primary ' +kind = "service-defaults" +name = "s1" +mesh_gateway { + mode = "remote" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s1" +redirect { + service = "s1" + datacenter = "secondary" +} +' register_services primary gen_envoy_bootstrap mesh-gateway 19002 primary true gen_envoy_bootstrap ingress-gateway 20000 primary true retry_default docker_consul primary curl -s "http://localhost:8500/v1/catalog/service/consul?dc=secondary" >/dev/null - diff --git a/test/integration/connect/envoy/case-l7-intentions/acl.hcl b/test/integration/connect/envoy/case-l7-intentions/acl.hcl new file mode 100644 index 000000000..5d6141ec7 --- /dev/null +++ b/test/integration/connect/envoy/case-l7-intentions/acl.hcl @@ -0,0 +1,3 @@ +acl { + default_policy = "deny" +} diff --git a/test/integration/connect/envoy/case-l7-intentions/config_entries.hcl b/test/integration/connect/envoy/case-l7-intentions/config_entries.hcl deleted file mode 100644 index e16a540a7..000000000 --- a/test/integration/connect/envoy/case-l7-intentions/config_entries.hcl +++ /dev/null @@ -1,97 +0,0 @@ -enable_central_service_config = true - -acl { - default_policy = "deny" -} - -config_entries { - bootstrap { - kind = "service-defaults" - name = "s2" - protocol = "http" - } - - # TODO: test header invert - bootstrap { - kind = "service-intentions" - name = "s2" - - sources { - name = "s1" - permissions = [ - // paths - { - action = "allow" - http { path_exact = "/exact" } - }, - { - action = "allow" - http { path_prefix = "/prefix" } - }, - { - action = "allow" - http { path_regex = "/reg[ex]{2}" } - }, - // headers - { - action = "allow" - http { - path_exact = "/hdr-present" - header = [{ - name = "x-test-debug" - present = true - }] - } - }, - { - action = "allow" - http { - path_exact = "/hdr-exact" - header = [{ - name = "x-test-debug" - exact = "exact" - }] - } - }, - { - action = "allow" - http { - path_exact = "/hdr-prefix" - header = [{ - name = "x-test-debug" - prefix = "prefi" - }] - } - }, - { - action = "allow" - http { - path_exact = "/hdr-suffix" - header = [{ - name = "x-test-debug" - suffix = "uffix" - }] - } - }, - { - action = "allow" - http { - path_exact = "/hdr-regex" - header = [{ - name = "x-test-debug" - regex = "reg[ex]{2}" - }] - } - }, - // methods - { - action = "allow" - http { - path_exact = "/method-match" - methods = ["GET", "PUT"] - } - } - ] - } - } -} diff --git a/test/integration/connect/envoy/case-l7-intentions/setup.sh b/test/integration/connect/envoy/case-l7-intentions/setup.sh index 33e147b09..5a2b73439 100644 --- a/test/integration/connect/envoy/case-l7-intentions/setup.sh +++ b/test/integration/connect/envoy/case-l7-intentions/setup.sh @@ -2,9 +2,93 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry service-defaults s2 -wait_for_config_entry service-intentions s2 +upsert_config_entry primary ' +kind = "service-defaults" +name = "s2" +protocol = "http" +' + +upsert_config_entry primary ' +kind = "service-intentions" +name = "s2" +sources { + name = "s1" + permissions = [ + // paths + { + action = "allow" + http { path_exact = "/exact" } + }, + { + action = "allow" + http { path_prefix = "/prefix" } + }, + { + action = "allow" + http { path_regex = "/reg[ex]{2}" } + }, + // headers + { + action = "allow" + http { + path_exact = "/hdr-present" + header = [{ + name = "x-test-debug" + present = true + }] + } + }, + { + action = "allow" + http { + path_exact = "/hdr-exact" + header = [{ + name = "x-test-debug" + exact = "exact" + }] + } + }, + { + action = "allow" + http { + path_exact = "/hdr-prefix" + header = [{ + name = "x-test-debug" + prefix = "prefi" + }] + } + }, + { + action = "allow" + http { + path_exact = "/hdr-suffix" + header = [{ + name = "x-test-debug" + suffix = "uffix" + }] + } + }, + { + action = "allow" + http { + path_exact = "/hdr-regex" + header = [{ + name = "x-test-debug" + regex = "reg[ex]{2}" + }] + } + }, + // methods + { + action = "allow" + http { + path_exact = "/method-match" + methods = ["GET", "PUT"] + } + } + ] +} +' register_services primary diff --git a/test/integration/connect/envoy/case-mesh-to-lambda/config_entries.hcl b/test/integration/connect/envoy/case-mesh-to-lambda/config_entries.hcl deleted file mode 100644 index 2cf6a2e28..000000000 --- a/test/integration/connect/envoy/case-mesh-to-lambda/config_entries.hcl +++ /dev/null @@ -1,12 +0,0 @@ -config_entries { - bootstrap { - kind = "terminating-gateway" - name = "terminating-gateway" - - services = [ - { - name = "l2" - } - ] - } -} diff --git a/test/integration/connect/envoy/case-mesh-to-lambda/setup.sh b/test/integration/connect/envoy/case-mesh-to-lambda/setup.sh index c187c8df2..ee8c69d7c 100644 --- a/test/integration/connect/envoy/case-mesh-to-lambda/setup.sh +++ b/test/integration/connect/envoy/case-mesh-to-lambda/setup.sh @@ -5,8 +5,15 @@ set -eEuo pipefail # Copy lambda config files into the register dir find ${CASE_DIR} -maxdepth 1 -name '*_l*.json' -type f -exec cp -f {} workdir/${CLUSTER}/register \; -# wait for tgw config entry -wait_for_config_entry terminating-gateway terminating-gateway +upsert_config_entry primary ' +kind = "terminating-gateway" +name = "terminating-gateway" +services = [ + { + name = "l2" + } +] +' register_services primary register_lambdas primary diff --git a/test/integration/connect/envoy/case-terminating-gateway-hostnames/config_entries.hcl b/test/integration/connect/envoy/case-terminating-gateway-hostnames/config_entries.hcl deleted file mode 100644 index 63e2106bf..000000000 --- a/test/integration/connect/envoy/case-terminating-gateway-hostnames/config_entries.hcl +++ /dev/null @@ -1,17 +0,0 @@ -config_entries { - bootstrap { - kind = "terminating-gateway" - name = "terminating-gateway" - - services = [ - { - name = "s4" - } - ] - } - bootstrap { - kind = "service-defaults" - name = "s4" - protocol = "http" - } -} diff --git a/test/integration/connect/envoy/case-terminating-gateway-hostnames/setup.sh b/test/integration/connect/envoy/case-terminating-gateway-hostnames/setup.sh index df98bbbbf..6b1e41575 100644 --- a/test/integration/connect/envoy/case-terminating-gateway-hostnames/setup.sh +++ b/test/integration/connect/envoy/case-terminating-gateway-hostnames/setup.sh @@ -2,8 +2,21 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry terminating-gateway terminating-gateway +upsert_config_entry primary ' +kind = "terminating-gateway" +name = "terminating-gateway" +services = [ + { + name = "s4" + } +] +' + +upsert_config_entry primary ' +kind = "service-defaults" +name = "s4" +protocol = "http" +' register_services primary diff --git a/test/integration/connect/envoy/case-terminating-gateway-simple/config_entries.hcl b/test/integration/connect/envoy/case-terminating-gateway-simple/config_entries.hcl deleted file mode 100644 index 0f4309d6d..000000000 --- a/test/integration/connect/envoy/case-terminating-gateway-simple/config_entries.hcl +++ /dev/null @@ -1,12 +0,0 @@ -config_entries { - bootstrap { - kind = "terminating-gateway" - name = "terminating-gateway" - - services = [ - { - name = "s2" - } - ] - } -} diff --git a/test/integration/connect/envoy/case-terminating-gateway-simple/setup.sh b/test/integration/connect/envoy/case-terminating-gateway-simple/setup.sh index df98bbbbf..11a2b4030 100644 --- a/test/integration/connect/envoy/case-terminating-gateway-simple/setup.sh +++ b/test/integration/connect/envoy/case-terminating-gateway-simple/setup.sh @@ -2,8 +2,15 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry terminating-gateway terminating-gateway +upsert_config_entry primary ' +kind = "terminating-gateway" +name = "terminating-gateway" +services = [ + { + name = "s2" + } +] +' register_services primary diff --git a/test/integration/connect/envoy/case-terminating-gateway-subsets/config_entries.hcl b/test/integration/connect/envoy/case-terminating-gateway-subsets/config_entries.hcl deleted file mode 100644 index 0459ba428..000000000 --- a/test/integration/connect/envoy/case-terminating-gateway-subsets/config_entries.hcl +++ /dev/null @@ -1,37 +0,0 @@ -config_entries { - bootstrap { - kind = "terminating-gateway" - name = "terminating-gateway" - - services = [ - { - name = "s2" - } - ] - } - - bootstrap { - kind = "proxy-defaults" - name = "global" - - config { - protocol = "http" - } - } - - bootstrap { - kind = "service-resolver" - name = "s2" - - default_subset = "v1" - - subsets = { - "v1" = { - filter = "Service.Meta.version == v1" - } - "v2" = { - filter = "Service.Meta.version == v2" - } - } - } -} diff --git a/test/integration/connect/envoy/case-terminating-gateway-subsets/setup.sh b/test/integration/connect/envoy/case-terminating-gateway-subsets/setup.sh index 850b47c68..fdd49572b 100644 --- a/test/integration/connect/envoy/case-terminating-gateway-subsets/setup.sh +++ b/test/integration/connect/envoy/case-terminating-gateway-subsets/setup.sh @@ -2,10 +2,37 @@ set -euo pipefail -# wait for bootstrap to apply config entries -wait_for_config_entry terminating-gateway terminating-gateway -wait_for_config_entry proxy-defaults global -wait_for_config_entry service-resolver s2 +upsert_config_entry primary ' +kind = "terminating-gateway" +name = "terminating-gateway" +services = [ + { + name = "s2" + } +] +' + +upsert_config_entry primary ' +kind = "proxy-defaults" +name = "global" +config { + protocol = "http" +} +' + +upsert_config_entry primary ' +kind = "service-resolver" +name = "s2" +default_subset = "v1" +subsets = { + "v1" = { + filter = "Service.Meta.version == v1" + } + "v2" = { + filter = "Service.Meta.version == v2" + } +} +' register_services primary diff --git a/test/integration/connect/envoy/helpers.bash b/test/integration/connect/envoy/helpers.bash index d0837a3ba..9991fb697 100755 --- a/test/integration/connect/envoy/helpers.bash +++ b/test/integration/connect/envoy/helpers.bash @@ -754,6 +754,13 @@ function wait_for_config_entry { retry_default read_config_entry "$@" >/dev/null } +function upsert_config_entry { + local DC="$1" + local BODY="$2" + + echo "$BODY" | docker_consul "$DC" config write - +} + function delete_config_entry { local KIND=$1 local NAME=$2