From c88f497de9dfdaacfdca84f7fdb49f19b601d959 Mon Sep 17 00:00:00 2001 From: Prashansa Kulshrestha Date: Wed, 6 Nov 2024 17:37:07 +0530 Subject: [PATCH] Fixing integration test failures for 3.8.1 release (#1428) * fix: integration test fixes for 3.8.1 * removed stray comments * fixed semver range for dump test --- tests/integration/diff_test.go | 40 ++- tests/integration/dump_test.go | 21 +- tests/integration/sync_test.go | 312 +++++++++++++++++- .../001-entities-with-tags/expected381.yaml | 237 +++++++++++++ .../expected-no-skip-381.yaml | 64 ++++ 5 files changed, 658 insertions(+), 16 deletions(-) create mode 100644 tests/integration/testdata/dump/001-entities-with-tags/expected381.yaml create mode 100644 tests/integration/testdata/dump/002-skip-consumers/expected-no-skip-381.yaml diff --git a/tests/integration/diff_test.go b/tests/integration/diff_test.go index 1262124f8..797f465bd 100644 --- a/tests/integration/diff_test.go +++ b/tests/integration/diff_test.go @@ -752,18 +752,38 @@ func Test_Diff_Unmasked_NewerThan3x(t *testing.T) { // test scope: // - 3.5 func Test_Diff_NoDiffUnorderedArray(t *testing.T) { - runWhen(t, "enterprise", ">=3.5.0") - setup(t) + tests := []struct { + name string + stateFile string + runWhen string + }{ + { + name: "no diffs with unordered arrays >=3.5.0 <3.8.1", + stateFile: "testdata/diff/004-no-diff-plugin/kong.yaml", + runWhen: ">=3.5.0 <3.8.1", + }, + // Uncomment post solving: https://konghq.atlassian.net/browse/FTI-6303 + // { + // name: "no diffs with unordered arrays >=3.8.1", + // stateFile: "testdata/diff/004-no-diff-plugin/kong.yaml", + // runWhen: ">=3.8.1", + // }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + runWhen(t, "enterprise", tc.runWhen) + setup(t) - // test that the diff command does not return any changes when - // array fields are not sorted. - stateFile := "testdata/diff/004-no-diff-plugin/kong.yaml" - assert.NoError(t, sync(stateFile, "--timeout", "60")) + // test that the diff command does not return any changes when + // array fields are not sorted. + assert.NoError(t, sync(tc.stateFile, "--timeout", "60")) - out, err := diff(stateFile) - assert.NoError(t, err) - assert.Equal(t, emptyOutput, out) - reset(t) + out, err := diff(tc.stateFile) + assert.NoError(t, err) + assert.Equal(t, emptyOutput, out) + reset(t) + }) + } } // test scope: diff --git a/tests/integration/dump_test.go b/tests/integration/dump_test.go index ac2c0c924..39b891bf6 100644 --- a/tests/integration/dump_test.go +++ b/tests/integration/dump_test.go @@ -47,16 +47,24 @@ func Test_Dump_SelectTags_3x(t *testing.T) { name string stateFile string expectedFile string + runWhen string }{ { - name: "dump with select-tags", + name: "dump with select-tags >=3.1.0 <3.8.1", stateFile: "testdata/dump/001-entities-with-tags/kong.yaml", expectedFile: "testdata/dump/001-entities-with-tags/expected.yaml", + runWhen: ">=3.1.0 <3.8.1", + }, + { + name: "dump with select-tags 3.8.1", + stateFile: "testdata/dump/001-entities-with-tags/kong.yaml", + expectedFile: "testdata/dump/001-entities-with-tags/expected381.yaml", + runWhen: ">=3.8.1", }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - runWhen(t, "kong", ">=3.1.0") + runWhen(t, "kong", tc.runWhen) setup(t) assert.NoError(t, sync(tc.stateFile)) @@ -123,7 +131,14 @@ func Test_Dump_SkipConsumers(t *testing.T) { stateFile: "testdata/dump/002-skip-consumers/kong34.yaml", expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip-35.yaml", skipConsumers: false, - runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.5.0") }, + runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.5.0 <3.8.1") }, + }, + { + name: "3.8.1 dump with no skip-consumers", + stateFile: "testdata/dump/002-skip-consumers/kong34.yaml", + expectedFile: "testdata/dump/002-skip-consumers/expected-no-skip-381.yaml", + skipConsumers: false, + runWhen: func(t *testing.T) { runWhen(t, "enterprise", ">=3.8.1") }, }, } for _, tc := range tests { diff --git a/tests/integration/sync_test.go b/tests/integration/sync_test.go index 173f7f9d1..7e9aa39dd 100644 --- a/tests/integration/sync_test.go +++ b/tests/integration/sync_test.go @@ -327,6 +327,72 @@ var ( }, } + plugin_on_entities381x = []*kong.Plugin{ //nolint:revive,stylecheck + { + Name: kong.String("prometheus"), + Protocols: []*string{ + kong.String("grpc"), + kong.String("grpcs"), + kong.String("http"), + kong.String("https"), + }, + Enabled: kong.Bool(true), + Config: kong.Configuration{ + "ai_metrics": false, + "bandwidth_metrics": false, + "latency_metrics": false, + "per_consumer": false, + "status_code_metrics": false, + "upstream_health_metrics": false, + }, + Service: &kong.Service{ + ID: kong.String("58076db2-28b6-423b-ba39-a797193017f7"), + }, + }, + { + Name: kong.String("prometheus"), + Protocols: []*string{ + kong.String("grpc"), + kong.String("grpcs"), + kong.String("http"), + kong.String("https"), + }, + Enabled: kong.Bool(true), + Config: kong.Configuration{ + "ai_metrics": false, + "bandwidth_metrics": false, + "latency_metrics": false, + "per_consumer": false, + "status_code_metrics": false, + "upstream_health_metrics": false, + }, + Route: &kong.Route{ + ID: kong.String("87b6a97e-f3f7-4c47-857a-7464cb9e202b"), + }, + }, + { + Name: kong.String("prometheus"), + Protocols: []*string{ + kong.String("grpc"), + kong.String("grpcs"), + kong.String("http"), + kong.String("https"), + }, + Enabled: kong.Bool(true), + Config: kong.Configuration{ + "ai_metrics": false, + "bandwidth_metrics": false, + "latency_metrics": false, + "per_consumer": false, + "status_code_metrics": false, + "upstream_health_metrics": false, + }, + Consumer: &kong.Consumer{ + ID: kong.String("d2965b9b-0608-4458-a9f8-0b93d88d03b8"), + }, + }, + } + plugin_on_entitiesKonnect = []*kong.Plugin{ //nolint:revive,stylecheck { Name: kong.String("prometheus"), @@ -1323,6 +1389,180 @@ var ( Protocols: []*string{kong.String("http"), kong.String("https")}, }, } + + consumerGroupScopedPlugins381x = []*kong.Plugin{ + { + Name: kong.String("rate-limiting-advanced"), + ConsumerGroup: &kong.ConsumerGroup{ + ID: kong.String("77e6691d-67c0-446a-9401-27be2b141aae"), + }, + Config: kong.Configuration{ + "consumer_groups": nil, + "dictionary_name": string("kong_rate_limiting_counters"), + "disable_penalty": bool(false), + "enforce_consumer_groups": bool(false), + "error_code": float64(429), + "error_message": string("API rate limit exceeded"), + "header_name": nil, + "hide_client_headers": bool(false), + "identifier": string("consumer"), + "limit": []any{float64(10)}, + "namespace": string("gold"), + "path": nil, + "redis": map[string]any{ + "cluster_addresses": nil, + "cluster_max_redirections": float64(5), + "cluster_nodes": nil, + "connect_timeout": float64(2000), + "connection_is_proxied": bool(false), + "database": float64(0), + "host": string("127.0.0.1"), + "keepalive_backlog": nil, + "keepalive_pool_size": float64(256), + "password": nil, + "port": float64(6379), + "read_timeout": float64(2000), + "send_timeout": float64(2000), + "sentinel_addresses": nil, + "sentinel_master": nil, + "sentinel_nodes": nil, + "sentinel_password": nil, + "sentinel_role": nil, + "sentinel_username": nil, + "server_name": nil, + "ssl": false, + "ssl_verify": false, + "timeout": float64(2000), + "username": nil, + }, + "retry_after_jitter_max": float64(1), + "strategy": string("local"), + "sync_rate": float64(-1), + "window_size": []any{float64(60)}, + "window_type": string("sliding"), + }, + Enabled: kong.Bool(true), + Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + }, + { + Name: kong.String("rate-limiting-advanced"), + ConsumerGroup: &kong.ConsumerGroup{ + ID: kong.String("5bcbd3a7-030b-4310-bd1d-2721ff85d236"), + }, + Config: kong.Configuration{ + "consumer_groups": nil, + "dictionary_name": string("kong_rate_limiting_counters"), + "disable_penalty": bool(false), + "enforce_consumer_groups": bool(false), + "error_code": float64(429), + "error_message": string("API rate limit exceeded"), + "header_name": nil, + "hide_client_headers": bool(false), + "identifier": string("consumer"), + "limit": []any{float64(7)}, + "namespace": string("silver"), + "path": nil, + "redis": map[string]any{ + "cluster_addresses": nil, + "cluster_max_redirections": float64(5), + "cluster_nodes": nil, + "connect_timeout": float64(2000), + "connection_is_proxied": bool(false), + "database": float64(0), + "host": string("127.0.0.1"), + "keepalive_backlog": nil, + "keepalive_pool_size": float64(256), + "password": nil, + "port": float64(6379), + "read_timeout": float64(2000), + "send_timeout": float64(2000), + "sentinel_addresses": nil, + "sentinel_master": nil, + "sentinel_nodes": nil, + "sentinel_password": nil, + "sentinel_role": nil, + "sentinel_username": nil, + "server_name": nil, + "ssl": false, + "ssl_verify": false, + "timeout": float64(2000), + "username": nil, + }, + "retry_after_jitter_max": float64(1), + "strategy": string("local"), + "sync_rate": float64(-1), + "window_size": []any{float64(60)}, + "window_type": string("sliding"), + }, + Enabled: kong.Bool(true), + Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + }, + { + Name: kong.String("rate-limiting-advanced"), + Config: kong.Configuration{ + "consumer_groups": nil, + "dictionary_name": string("kong_rate_limiting_counters"), + "disable_penalty": bool(false), + "enforce_consumer_groups": bool(false), + "error_code": float64(429), + "error_message": string("API rate limit exceeded"), + "header_name": nil, + "hide_client_headers": bool(false), + "identifier": string("consumer"), + "limit": []any{float64(5)}, + "namespace": string("silver"), + "path": nil, + "redis": map[string]any{ + "cluster_addresses": nil, + "cluster_max_redirections": float64(5), + "cluster_nodes": nil, + "connect_timeout": float64(2000), + "connection_is_proxied": bool(false), + "database": float64(0), + "host": string("127.0.0.1"), + "keepalive_backlog": nil, + "keepalive_pool_size": float64(256), + "password": nil, + "port": float64(6379), + "read_timeout": float64(2000), + "send_timeout": float64(2000), + "sentinel_addresses": nil, + "sentinel_master": nil, + "sentinel_nodes": nil, + "sentinel_password": nil, + "sentinel_role": nil, + "sentinel_username": nil, + "server_name": nil, + "ssl": false, + "ssl_verify": false, + "timeout": float64(2000), + "username": nil, + }, + "retry_after_jitter_max": float64(1), + "strategy": string("local"), + "sync_rate": float64(-1), + "window_size": []any{float64(60)}, + "window_type": string("sliding"), + }, + Enabled: kong.Bool(true), + Protocols: []*string{kong.String("grpc"), kong.String("grpcs"), kong.String("http"), kong.String("https")}, + }, + { + Name: kong.String("key-auth"), + Config: kong.Configuration{ + "anonymous": nil, + "hide_credentials": false, + "key_in_body": false, + "key_in_header": true, + "key_in_query": true, + "key_names": []interface{}{"apikey"}, + "realm": nil, // This is present on 3.7.x+ + "run_on_preflight": true, + }, + Enabled: kong.Bool(true), + Protocols: []*string{kong.String("http"), kong.String("https")}, + }, + } ) // test scope: @@ -2728,9 +2968,10 @@ func Test_Sync_PluginsOnEntitiesFrom_3_0_0(t *testing.T) { name string kongFile string expectedState utils.KongRawState + runWhen string }{ { - name: "create plugins on services, routes and consumers", + name: "create plugins on services, routes and consumers <3.8.1", kongFile: "testdata/sync/xxx-plugins-on-entities/kong.yaml", expectedState: utils.KongRawState{ Services: svc1_207, @@ -2738,12 +2979,24 @@ func Test_Sync_PluginsOnEntitiesFrom_3_0_0(t *testing.T) { Plugins: plugin_on_entities3x, Consumers: consumer, }, + runWhen: ">=3.0.0 <3.8.1", + }, + { + name: "create plugins on services, routes and consumers >=3.8.1", + kongFile: "testdata/sync/xxx-plugins-on-entities/kong.yaml", + expectedState: utils.KongRawState{ + Services: svc1_207, + Routes: route1_20x, + Plugins: plugin_on_entities381x, + Consumers: consumer, + }, + runWhen: ">=3.8.1", }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - runWhen(t, "kong", ">=3.0.0") + runWhen(t, "kong", tc.runWhen) setup(t) sync(tc.kongFile) @@ -4571,7 +4824,7 @@ func Test_Sync_ConsumerGroupsScopedPlugins_After360(t *testing.T) { }, { name: "creates consumer groups scoped plugins", - runWhen: ">=3.7.0", + runWhen: ">=3.7.0 <3.8.1", kongFile: "testdata/sync/025-consumer-groups-scoped-plugins/kong3x.yaml", expectedState: utils.KongRawState{ Consumers: consumerGroupsConsumers, @@ -4622,6 +4875,59 @@ func Test_Sync_ConsumerGroupsScopedPlugins_After360(t *testing.T) { }, }, }, + { + name: "creates consumer groups scoped plugins", + runWhen: ">=3.8.1", + kongFile: "testdata/sync/025-consumer-groups-scoped-plugins/kong3x.yaml", + expectedState: utils.KongRawState{ + Consumers: consumerGroupsConsumers, + ConsumerGroups: []*kong.ConsumerGroupObject{ + { + ConsumerGroup: &kong.ConsumerGroup{ + Name: kong.String("silver"), + }, + Consumers: []*kong.Consumer{ + { + Username: kong.String("bar"), + }, + }, + }, + { + ConsumerGroup: &kong.ConsumerGroup{ + Name: kong.String("gold"), + }, + Consumers: []*kong.Consumer{ + { + Username: kong.String("foo"), + }, + }, + }, + }, + Plugins: consumerGroupScopedPlugins381x, + Services: svc1_207, + Routes: route1_20x, + KeyAuths: []*kong.KeyAuth{ + { + Consumer: &kong.Consumer{ + ID: kong.String("87095815-5395-454e-8c18-a11c9bc0ef04"), + }, + Key: kong.String("i-am-special"), + }, + { + Consumer: &kong.Consumer{ + ID: kong.String("5a5b9369-baeb-4faa-a902-c40ccdc2928e"), + }, + Key: kong.String("i-am-not-so-special"), + }, + { + Consumer: &kong.Consumer{ + ID: kong.String("e894ea9e-ad08-4acf-a960-5a23aa7701c7"), + }, + Key: kong.String("i-am-just-average"), + }, + }, + }, + }, } for _, tc := range tests { t.Run(tc.name+"/"+tc.runWhen, func(t *testing.T) { diff --git a/tests/integration/testdata/dump/001-entities-with-tags/expected381.yaml b/tests/integration/testdata/dump/001-entities-with-tags/expected381.yaml new file mode 100644 index 000000000..4a75042c6 --- /dev/null +++ b/tests/integration/testdata/dump/001-entities-with-tags/expected381.yaml @@ -0,0 +1,237 @@ +_format_version: "3.0" +_info: + defaults: {} + select_tags: + - managed-by-deck + - org-unit-42 +certificates: +- cert: | + -----BEGIN CERTIFICATE----- + MIIC1jCCAb4CCQCt23nwvxSCvjANBgkqhkiG9w0BAQsFADAtMRYwFAYDVQQDDA0q + LmV4YW1wbGUuY29tMRMwEQYDVQQKDAprb25naHEub3JnMB4XDTE4MTIzMTIwMTkw + MVoXDTE5MTIzMTIwMTkwMVowLTEWMBQGA1UEAwwNKi5leGFtcGxlLmNvbTETMBEG + A1UECgwKa29uZ2hxLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB + AKj/2r1AXo9x+2Csrd0SHbpnzuW+xYqgsd+YA9ZrZNV7SZGSbaZymsRMz8wg5OIU + iUik2GM1749/lYvojLFStBPy9UY/gd++5f3wLp4xHiI+IU2XQ97otXKGfyh36RmN + dKDqPLN8BG3R346s/y1GOulFvLthYmZVYF9ufHiqimfEDSbTt79P5C3X0Rw/afK1 + GjHEJPCB/XkZ6lkcEyL6LqZI5oBigDqa9hI/nWLxEzfm8pgosiS38p9TAijlOkpm + tX2p2b1pktlNIy3rxsqj6IynN9Wc7FpV1N4HoPKV7vQQ08hjwW6WfanVthaaJosj + Vr2TBCJ1ltAmsb+5B2VPYVkCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAnByTyQfV + 3LkwuoWS57CWcqbNw/cHnv/ChzmIv+6mIXvDBSvCgrPZIWCpaCfYRG6R51E44fr/ + 8V1AKT0Zt15DjrXEEcIGQgsIDO91/wlL091fTAUzSbL0yt7HTlm8sX6xndPNAZrq + cfcIPVMxknfqPy2VqS4IrNC03pHkDKtokphBjVUlkiWsdcq+fHYbS2xL2d1Da/uN + hX/iwgo+v5gOF5xtaXx7D7L3Cf+MHb/MOXWPfYXNiTpSBVX8/Kx5RP+QLI16nWvw + lrijTlXZFR8NIZBrCo/QZ2cNbUAbN3R0n+/kMFubxBL8WEm6Qhi9jBjbJeDMspd8 + C+/TZJQMpx5vyA== + -----END CERTIFICATE----- + id: 13c562a1-191c-4464-9b18-e5222b46035b + key: | + -----BEGIN PRIVATE KEY----- + MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCo/9q9QF6Pcftg + rK3dEh26Z87lvsWKoLHfmAPWa2TVe0mRkm2mcprETM/MIOTiFIlIpNhjNe+Pf5WL + 6IyxUrQT8vVGP4HfvuX98C6eMR4iPiFNl0Pe6LVyhn8od+kZjXSg6jyzfARt0d+O + rP8tRjrpRby7YWJmVWBfbnx4qopnxA0m07e/T+Qt19EcP2nytRoxxCTwgf15GepZ + HBMi+i6mSOaAYoA6mvYSP51i8RM35vKYKLIkt/KfUwIo5TpKZrV9qdm9aZLZTSMt + 68bKo+iMpzfVnOxaVdTeB6Dyle70ENPIY8Fuln2p1bYWmiaLI1a9kwQidZbQJrG/ + uQdlT2FZAgMBAAECggEAVnyRcda2Tcy0K7ZTR9aUlie370VhDN/OB7JhDGNreAEf + FjuMl+kAoUL5+OpAmB6QXzfVcXhRv+s4GiCJl9nORINK2Id5rIqiYwF+qgBS/o0z + N+UYm8QVz6Va/9fV1/jXXd5h8Cygi58jPH32HTJaxbSlsHNXCy3YIx6E3q/QIueR + 6ZdSXPqMEqxEU19M9jW8UeiRFrpmcyYxVpfxYIY/+O9lYjSpaeLs7hZeCP9PqWXA + Sxz2CnHZ8BcsDxAyuoHoVw+kjMpUMvA3sD4lwkV8BAYzfLmQf6PR83SFNsrE8XYu + /8WnQuCuytcl8Zg55R6tGCvf6Wyyf+MDRPwv/43QMQKBgQDbqK9Dq54k+EHgSNnP + K6AhNjFd6aqcNC1kom/sSlWBnuA/BEqJMECr8S2dYvzONUPPfX5NNUjB4Vw3Qw7a + pUgKuCQoVpzpZs5m1bk78itWDtA84LjkXfdejnUXVw/aVxLCM5QV9aEkm/dEWWMI + P1WTYVoWoZCLlEE08q0AvZQcdQKBgQDE9ZCmc6ncmhnQftuRj5PnXG2a79MLCT61 + sCEBDVvkcUJVqbzwGRLwRkdIzLgvmiuP+SukHgyfr8/RXG99xEW/q7NDrtEcqfXP + 19QXwOIp5NwDnOXyAlXiyZ50fCE2tSo2wP485+NIhmKj5Zt6y/DL6Qbc5k73XmK4 + KX5Ej15k1QKBgQCc6KeiIFLMt+Ze78tfORue/dZP7p3oDUGr1Hk9AnCIMlSfz1Hr + I+Per17VQaOzLcttyYhSYNDDZld4RlezCkQnHBkAE7bs53pjbSJv1vLr+5L3GdQZ + laIiEoNEE/YIExEcVrne4eKlgyAj2/JpLszThcRTzD+z5UibKQs6LzJBDQKBgDVa + dAGzCUt57w48nwvyQdWFgydaWef+bB9Zg8c+MCtUxuxfm4/Kqwetcff1hNtYPv60 + N68weKj1Pi1vhcAi3+YJA/mMrJbAL5dK1uhMVreUiEjuQpfpLAzQIv1Y9sJUFwhY + BUbIZhgqVyQguZptDmCeUj6aoL9/sOxESTEXSTG1AoGBAMQ5iJZMsdLCERv0+6Y1 + F/t/YSW8cugB3vdV9jHZuosoprz48p92pYP8OdQc70H5hZt53hoYNgYFSd+MU6H1 + hJCaXTsiP4IUmBjiwzSp3o1ctP8lWvnyJpAadYdDhaDaAAoaMjCo9cm5OMwc8t8x + hwAPXV2cgWH8fPcT9NLAcwWk + -----END PRIVATE KEY----- + snis: + - name: demo1.example.com + - name: demo2.example.com + - name: demo3.example.com + tags: + - cloudops-managed +consumers: +- acls: + - group: foo-group + hmacauth_credentials: + - secret: yeNZBeqCuk0D3H85VX77Umacf91MwqRo + username: hmac-user + jwt_secrets: + - algorithm: HS256 + key: MKWeR0nu9OAUR9HrjpUG82Hbfz7ZXsIw + secret: 6gkrxTKAraykMSpmnLNEGiEE3Yz8XL6U + keyauth_credentials: + - key: iwb6Djkk4HhUlOCmLilDIKh6nZrn90ts + username: harry +plugins: +- config: + ai_metrics: false + bandwidth_metrics: false + latency_metrics: false + per_consumer: false + status_code_metrics: false + upstream_health_metrics: false + enabled: true + name: prometheus + protocols: + - http + - https +services: +- connect_timeout: 60000 + enabled: true + host: mockbin.org + name: svc1 + port: 80 + protocol: http + read_timeout: 60000 + retries: 5 + routes: + - https_redirect_status_code: 301 + name: r1 + path_handling: v0 + paths: + - /r1 + preserve_host: false + protocols: + - http + - https + regex_priority: 0 + request_buffering: true + response_buffering: true + strip_path: true + tags: + - team-svc1 + write_timeout: 60000 +- connect_timeout: 60000 + enabled: true + host: mockbin.org + name: svc2 + port: 80 + protocol: http + read_timeout: 60000 + retries: 5 + routes: + - https_redirect_status_code: 301 + name: r2 + path_handling: v0 + paths: + - /r2 + preserve_host: false + protocols: + - http + - https + regex_priority: 0 + request_buffering: true + response_buffering: true + strip_path: true + write_timeout: 60000 +- connect_timeout: 60000 + enabled: true + host: mockbin.org + name: svc3 + port: 80 + protocol: http + read_timeout: 60000 + retries: 5 + routes: + - https_redirect_status_code: 301 + methods: + - GET + name: r3 + path_handling: v0 + paths: + - /r3 + preserve_host: false + protocols: + - http + - https + regex_priority: 0 + request_buffering: true + response_buffering: true + strip_path: true + write_timeout: 60000 +upstreams: +- algorithm: round-robin + hash_fallback: none + hash_on: none + hash_on_cookie_path: / + healthchecks: + active: + concurrency: 10 + healthy: + http_statuses: + - 200 + - 302 + interval: 0 + successes: 0 + http_path: / + https_verify_certificate: true + timeout: 1 + type: http + unhealthy: + http_failures: 0 + http_statuses: + - 429 + - 404 + - 500 + - 501 + - 502 + - 503 + - 504 + - 505 + interval: 0 + tcp_failures: 0 + timeouts: 0 + passive: + healthy: + http_statuses: + - 200 + - 201 + - 202 + - 203 + - 204 + - 205 + - 206 + - 207 + - 208 + - 226 + - 300 + - 301 + - 302 + - 303 + - 304 + - 305 + - 306 + - 307 + - 308 + successes: 0 + type: http + unhealthy: + http_failures: 0 + http_statuses: + - 429 + - 500 + - 503 + tcp_failures: 0 + timeouts: 0 + threshold: 0 + name: upstream1 + slots: 10000 + targets: + - target: 198.51.100.11:80 + weight: 100 + - target: 198.51.100.12:80 + weight: 100 + - target: 198.51.100.13:80 + weight: 100 + use_srv_name: false diff --git a/tests/integration/testdata/dump/002-skip-consumers/expected-no-skip-381.yaml b/tests/integration/testdata/dump/002-skip-consumers/expected-no-skip-381.yaml new file mode 100644 index 000000000..3a82a3f0d --- /dev/null +++ b/tests/integration/testdata/dump/002-skip-consumers/expected-no-skip-381.yaml @@ -0,0 +1,64 @@ +_format_version: "3.0" +consumer_groups: +- name: basic + plugins: + - config: + consumer_groups: null + dictionary_name: kong_rate_limiting_counters + disable_penalty: false + enforce_consumer_groups: false + error_code: 429 + error_message: API rate limit exceeded + header_name: null + hide_client_headers: false + identifier: consumer + limit: + - 30000 + namespace: basic + path: null + redis: + cluster_addresses: null + cluster_max_redirections: 5 + cluster_nodes: null + connect_timeout: 2000 + connection_is_proxied: false + database: 0 + host: 127.0.0.1 + keepalive_backlog: null + keepalive_pool_size: 256 + password: null + port: 6379 + read_timeout: 2000 + send_timeout: 2000 + sentinel_addresses: null + sentinel_master: null + sentinel_nodes: null + sentinel_password: null + sentinel_role: null + sentinel_username: null + server_name: null + ssl: false + ssl_verify: false + timeout: 2000 + username: null + retry_after_jitter_max: 0 + strategy: local + sync_rate: -1 + window_size: + - 2628000 + window_type: sliding + name: rate-limiting-advanced +consumers: +- groups: + - name: basic + username: foo +services: +- connect_timeout: 60000 + enabled: true + host: mockbin.org + name: svc1 + port: 80 + protocol: http + read_timeout: 60000 + retries: 5 + write_timeout: 60000