-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(kuma-cp): specifying IPv6 Envoy Admin address breaks readiness/li…
…veness probes (backport of #7909) (#7926) * fix(kuma-cp): specifying IPv6 Envoy Admin address breaks readiness/liveness probes (#7909) Put a specified admin address to proxy metadata and use it when generating an admin cluster. * test(unit): fix flaky "should return error when admin address is not allowed" test (#7933) fix(kuma-cp): use SortedKeys function in error msg * make SortedKeys generic * chore(kuma-cp): improve error message for invalid admin addresses (#7934) * update golden files Signed-off-by: Ilya Lobkov <[email protected]> Signed-off-by: Mike Beaumont <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]> Co-authored-by: Mike Beaumont <[email protected]>
- Loading branch information
1 parent
d173e7b
commit 4aef4e5
Showing
21 changed files
with
531 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package maps | ||
|
||
import "sort" | ||
import ( | ||
"golang.org/x/exp/constraints" | ||
"golang.org/x/exp/maps" | ||
"golang.org/x/exp/slices" | ||
) | ||
|
||
func SortedKeys(m map[string]string) []string { | ||
var keys []string | ||
for key := range m { | ||
keys = append(keys, key) | ||
} | ||
sort.Strings(keys) | ||
func SortedKeys[M ~map[K]V, K constraints.Ordered, V any](m M) []K { | ||
keys := maps.Keys(m) | ||
slices.Sort(keys) | ||
return keys | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
type: Dataplane | ||
name: web-1 | ||
mesh: default | ||
networking: | ||
address: 192.168.0.1 | ||
inbound: | ||
- port: 1234 | ||
tags: | ||
kuma.io/service: web |
94 changes: 94 additions & 0 deletions
94
pkg/xds/generator/testdata/admin/02.envoy-config.golden.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
resources: | ||
- name: kuma:envoy:admin | ||
resource: | ||
'@type': type.googleapis.com/envoy.config.cluster.v3.Cluster | ||
altStatName: kuma_envoy_admin | ||
connectTimeout: 10s | ||
loadAssignment: | ||
clusterName: kuma:envoy:admin | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 127.0.0.1 | ||
portValue: 9901 | ||
name: kuma:envoy:admin | ||
type: STATIC | ||
- name: kuma:envoy:admin | ||
resource: | ||
'@type': type.googleapis.com/envoy.config.listener.v3.Listener | ||
address: | ||
socketAddress: | ||
address: 192.168.0.1 | ||
portValue: 9901 | ||
enableReusePort: false | ||
filterChains: | ||
- filters: | ||
- name: envoy.filters.network.http_connection_manager | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager | ||
httpFilters: | ||
- name: envoy.filters.http.router | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router | ||
routeConfig: | ||
validateClusters: false | ||
virtualHosts: | ||
- domains: | ||
- '*' | ||
name: kuma:envoy:admin | ||
routes: | ||
- match: | ||
prefix: /ready | ||
route: | ||
cluster: kuma:envoy:admin | ||
prefixRewrite: /ready | ||
statPrefix: kuma_envoy_admin | ||
- filterChainMatch: | ||
transportProtocol: tls | ||
filters: | ||
- name: envoy.filters.network.http_connection_manager | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager | ||
httpFilters: | ||
- name: envoy.filters.http.router | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router | ||
routeConfig: | ||
validateClusters: false | ||
virtualHosts: | ||
- domains: | ||
- '*' | ||
name: kuma:envoy:admin | ||
routes: | ||
- match: | ||
prefix: / | ||
route: | ||
cluster: kuma:envoy:admin | ||
prefixRewrite: / | ||
statPrefix: kuma_envoy_admin | ||
transportSocket: | ||
name: envoy.transport_sockets.tls | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext | ||
commonTlsContext: | ||
tlsCertificates: | ||
- certificateChain: | ||
inlineBytes: Y2VydFBFTQ== | ||
privateKey: | ||
inlineBytes: a2V5UEVN | ||
validationContext: | ||
matchTypedSubjectAltNames: | ||
- matcher: | ||
exact: kuma-cp | ||
sanType: DNS | ||
trustedCa: | ||
inlineBytes: Y2FQRU0= | ||
requireClientCertificate: true | ||
listenerFilters: | ||
- name: envoy.filters.listener.tls_inspector | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector | ||
name: kuma:envoy:admin | ||
trafficDirection: INBOUND |
Oops, something went wrong.