-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helm namespace mirroring #1601
Helm namespace mirroring #1601
Conversation
1519e37
to
6e9c0a7
Compare
@@ -1,6 +1,5 @@ | |||
{{- if and .Values.global.peering.enabled (not .Values.connectInject.enabled) }}{{ fail "setting global.peering.enabled to true requires connectInject.enabled to be true" }}{{ end }} | |||
{{- if (or (and (ne (.Values.connectInject.enabled | toString) "-") .Values.connectInject.enabled) (and (eq (.Values.connectInject.enabled | toString) "-") .Values.global.enabled)) }} | |||
{{- if and .Values.connectInject.consulNamespaces.mirroringK8S (not .Values.global.enableConsulNamespaces) }}{{ fail "global.enableConsulNamespaces must be true if mirroringK8S=true" }}{{ end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of failing here, I have the enable mirroring flag check for both conditions to be true in order to be passed to inject-connect
.
|
||
local actual=$(echo $object | | ||
yq 'any(contains("k8s-namespace-mirroring-prefix"))' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
} | ||
|
||
@test "connectInject/Deployment: mirroring options set with .connectInject.consulNamespaces.mirroringK8S=true" { | ||
@test "connectInject/Deployment: mirroring options omitted with .connectInject.consulNamespaces.mirroringK8S=false" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition this checked is now covered by the test on line 681. I changed it to check the opposite case as it is no longer the default behavior.
…oringK8S` to `true`
6e9c0a7
to
f908106
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!! nicely done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Changes proposed in this PR:
syncCatalog.consulNamespaces.mirroringK8S
now defaults totrue
connectInject.consulNamespaces.mirroringK8S
now defaults totrue
connectInject.consulNamespaces.mirrorK8S=true
andglobal.enableConsulNamespaces=false
, theconnect-inject-deployment.yaml
template instead checks for both to be true in order to pass the-enable-k8s-namespace-mirroring=true
flag. That means,connectInject.consulNamespaces.mirrorK8S=true
andglobal.enableConsulNamespaces=false
is now a valid deployment configuration that will simply not tell Consul to perform mirroring given that Consul namespaces is nottrue
.How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: