Skip to content

feat: Add support for key+ syntax #2088

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nocturo
Copy link

@nocturo nocturo commented Jun 25, 2025

This PR adds support for key+ syntax that is used in several other places for appending to lists and maps instead of overwriting them and keeping your code DRY (in case you want to append to some map you've defined before).

How would you use it?

helmfile.yaml:

repositories:
  - name: bitnami
    url: https://charts.bitnami.com/bitnami

releases:
  - name: myapp
    namespace: default
    chart: bitnami/nginx
    version: 15.0.0
    values:
      - base.yaml
      - override.yaml

base.yaml:

replicaCount: 2
image:
  tag: "1.21"
  pullPolicy: IfNotPresent

service:
  type: ClusterIP
  port: 80

ingress:
  enabled: false

resources:
  limits:
    cpu: 100m
    memory: 128Mi
  requests:
    cpu: 100m
    memory: 128Mi

labels:
  app: myapp
  environment: dev

override.yaml:

replicaCount+: 3
image+:
  tag: "1.25"

service+:
  type: LoadBalancer
  port: 443

ingress+:
  enabled: true
  hosts:
    - host: myapp.example.com

resources+:
  limits:
    cpu: 200m
    memory: 256Mi

labels+:
  environment: prod
  team: platform

and we get these values out:

image:
  pullPolicy: IfNotPresent
  tag: "1.25"
ingress:
  enabled: true
  hosts:
    - host: myapp.example.com
labels:
  app: myapp
  environment: prod
  team: platform
replicaCount: 3
resources:
  limits:
    cpu: 200m
    memory: 256Mi
  requests:
    cpu: 100m
    memory: 128Mi
service:
  port: 443
  type: LoadBalancer

Let me know if this is something that can benefit the project.

@yxxhero
Copy link
Member

yxxhero commented Jun 25, 2025

please fix DCO

@yxxhero
Copy link
Member

yxxhero commented Jun 25, 2025

@nocturo

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

Successfully merging this pull request may close these issues.

2 participants