Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Pass extraVolumes last for -config-dir #531

Merged
merged 1 commit into from Jul 7, 2020
Merged

Pass extraVolumes last for -config-dir #531

merged 1 commit into from Jul 7, 2020

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented Jul 6, 2020

This will allow user-defined config to override any config set in the
helm-created config map because Consul will override previous
configuration with the last -config-dir.

For example, this user (hashicorp/consul-k8s#220) wants to specify the "acl": {"down_policy": "your-policy"} config which is set in /consul/aclconfig by the helm chart (technically it's written by consul-k8s acl-init). By swapping the ordering here, they can now create their own configmap which sets

"acl": {"down_policy": "their-policy"}

and pass it in via

client:
  extraVolumes:
  - type: configMap
     name: my-config-map
     load: true

And that single key will be overridden.

Fixes hashicorp/consul-k8s#220

@lkysow lkysow requested review from a team, kschoche and thisisnotashwin and removed request for a team July 6, 2020 23:43
Copy link
Contributor

@kschoche kschoche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Copy link
Contributor

@thisisnotashwin thisisnotashwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE!

This will allow user-defined config to override any config set in the
helm-created config map because Consul will override previous
configuration with the last -config-dir.
@lkysow lkysow merged commit 8637995 into master Jul 7, 2020
@lkysow lkysow deleted the config-dir-order branch July 7, 2020 17:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants