Skip to content
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

Support merging (json) values from two configmap keys #289

Closed
simonkotwicz opened this issue Aug 25, 2021 · 2 comments · Fixed by #290
Closed

Support merging (json) values from two configmap keys #289

simonkotwicz opened this issue Aug 25, 2021 · 2 comments · Fixed by #290
Assignees
Labels
enhancement New feature or request

Comments

@simonkotwicz
Copy link
Contributor

simonkotwicz commented Aug 25, 2021

Is your feature request related to a problem? Please describe.
We are trying to simplify our deployment files and configmaps. Right now they are very messy due to the fact that we are trying to merge multiple configmap values that are in the form of stringified json values. Because this is not natively supported we end up with very messy workarounds.

Describe the solution you'd like
Support merging (json) values from two configmap keys, something like:

  env:
    - name: my-service
      valueFrom:
        configMapKeyRef:
          name: default
          key: my-service
          type: json
    - name: my-service
      overrideStrategy: merge # default would be replace
      valueFrom:
        configMapKeyRef:
          name: overrides
          key: my-service
          type: json

or

  envFrom:
  - configMapKeyRef:
      name: default
      key: my-service
  - configMapKeyRef:
      name: overrides
      key: my-service

Describe alternatives you've considered
Alternatives include:

  • using envFrom and both splitting up our configmaps as well as flattening them out (to remove stringified json values) so that we can leverage the merging that is currently supported with envFrom
@alewitt2 alewitt2 linked a pull request Aug 25, 2021 that will close this issue
@alewitt2
Copy link
Member

alewitt2 commented Aug 26, 2021

#290 is almost done and i will get a release out for it today. I also when ahead and added some extra handlebar helpers that i think you may need as you start to pull in and merge json data and try to write them back out to configmaps. Thats just a gut feeling though, if you dont use them, no worries

@alewitt2 alewitt2 self-assigned this Aug 26, 2021
@alewitt2 alewitt2 added the enhancement New feature or request label Aug 26, 2021
@alewitt2
Copy link
Member

alewitt2 commented Aug 26, 2021

version 0.16.0 is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants