Skip to content

Commit

Permalink
Adds back manageNonStandardCRDs option to the helm chart (#4213)
Browse files Browse the repository at this point in the history
* Adds back manageNonStandardCRDs option to the helm chart
  • Loading branch information
missylbytes authored Jul 30, 2024
1 parent 7a34565 commit 9c3d1fe
Showing 3 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .changelog/4213.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
Fixes install of Consul on GKE Autopilot where the option 'manageNonStandardCRDs' was not being used for the TCPRoute CRD.
```
2 changes: 1 addition & 1 deletion charts/consul/templates/crd-tcproutes-external.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.connectInject.enabled .Values.connectInject.apiGateway.manageExternalCRDs }}
{{- if and .Values.connectInject.enabled (or .Values.connectInject.apiGateway.manageExternalCRDs .Values.connectInject.apiGateway.manageNonStandardCRDs ) }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
20 changes: 12 additions & 8 deletions charts/consul/test/unit/crd-tcproutes-external.bats
Original file line number Diff line number Diff line change
@@ -16,15 +16,18 @@ load _helpers
assert_empty helm template \
-s templates/crd-tcproutes-external.yaml \
--set 'connectInject.enabled=false' \
.
.
}

@test "tcproutes/CustomResourceDefinition: disabled with connectInject.apiGateway.manageExternalCRDs=false" {
@test "tcproutes/CustomResourceDefinition: enabled with connectInject.apiGateway.manageExternalCRDs=true and connectInject.apiGateway.manageNonStandardCRDs=false" {
cd `chart_dir`
assert_empty helm template \
local actual=$(helm template \
-s templates/crd-tcproutes-external.yaml \
--set 'connectInject.apiGateway.manageExternalCRDs=false' \
.
--set 'connectInject.apiGateway.manageExternalCRDs=true' \
--set 'connectInject.apiGateway.manageNonStandardCRDs=false' \
. | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

@test "tcproutes/CustomResourceDefinition: disabled with connectInject.apiGateway.manageExternalCRDs=false and connectInject.apiGateway.manageNonStandardCRDs=false" {
@@ -33,15 +36,16 @@ load _helpers
-s templates/crd-tcproutes-external.yaml \
--set 'connectInject.apiGateway.manageExternalCRDs=false' \
--set 'connectInject.apiGateway.manageNonStandardCRDs=false' \
.
.
}

@test "tcproutes/CustomResourceDefinition: enabled with connectInject.apiGateway.manageNonStandardCRDs=true" {
@test "tcproutes/CustomResourceDefinition: enabled with connectInject.apiGateway.manageExternalCRDs=false and connectInject.apiGateway.manageNonStandardCRDs=true" {
cd `chart_dir`
local actual=$(helm template \
-s templates/crd-tcproutes-external.yaml \
--set 'connectInject.apiGateway.manageExternalCRDs=false' \
--set 'connectInject.apiGateway.manageNonStandardCRDs=true' \
. | tee /dev/stderr |
yq -s 'length > 0' | tee /dev/stderr)
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

0 comments on commit 9c3d1fe

Please sign in to comment.