Skip to content

Commit

Permalink
Fix Sync Catalog ACL Token Environment Var Name (#2068)
Browse files Browse the repository at this point in the history
* Fix Sync Catalog ACL Token Environment Var Name
* Update ACL variable name in tests
  • Loading branch information
mbillow authored and absolutelightning committed Aug 4, 2023
1 parent 56a9309 commit 42044ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/consul/templates/sync-catalog-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
{{- if (and .Values.syncCatalog.aclSyncToken.secretName .Values.syncCatalog.aclSyncToken.secretKey) }}
- name: CONSUL_HTTP_TOKEN
- name: CONSUL_ACL_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Values.syncCatalog.aclSyncToken.secretName }}
Expand Down
6 changes: 3 additions & 3 deletions charts/consul/test/unit/sync-catalog-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ load _helpers
--set 'syncCatalog.enabled=true' \
--set 'syncCatalog.aclSyncToken.secretKey=bar' \
. | tee /dev/stderr |
yq '[.spec.template.spec.containers[0].env[].name] | any(contains("CONSUL_HTTP_TOKEN"))' | tee /dev/stderr)
yq '[.spec.template.spec.containers[0].env[].name] | any(contains("CONSUL_ACL_TOKEN"))' | tee /dev/stderr)
[ "${actual}" = "false" ]
}

Expand All @@ -349,7 +349,7 @@ load _helpers
--set 'syncCatalog.enabled=true' \
--set 'syncCatalog.aclSyncToken.secretName=foo' \
. | tee /dev/stderr |
yq '[.spec.template.spec.containers[0].env[].name] | any(contains("CONSUL_HTTP_TOKEN"))' | tee /dev/stderr)
yq '[.spec.template.spec.containers[0].env[].name] | any(contains("CONSUL_ACL_TOKEN"))' | tee /dev/stderr)
[ "${actual}" = "false" ]
}

Expand All @@ -361,7 +361,7 @@ load _helpers
--set 'syncCatalog.aclSyncToken.secretName=foo' \
--set 'syncCatalog.aclSyncToken.secretKey=bar' \
. | tee /dev/stderr |
yq '[.spec.template.spec.containers[0].env[].name] | any(contains("CONSUL_HTTP_TOKEN"))' | tee /dev/stderr)
yq '[.spec.template.spec.containers[0].env[].name] | any(contains("CONSUL_ACL_TOKEN"))' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

Expand Down

0 comments on commit 42044ff

Please sign in to comment.