OT-CONTAINER-KIT / helm-charts

A repository which that will contain helm charts with best and security practices.
https://ot-container-kit.github.io/helm-charts
49 stars 84 forks source link

Remove empty redisConfig when externalConfig is set #45

Closed legigor closed 1 year ago

legigor commented 2 years ago

When externalConfig.enabled is set to true, it renders both sections in the final YAML. I.e.

spec:
  redisConfig: # <--------------------------- here
    additionalRedisConfig: redis-external-config
  redisExporter:
    enabled: true
    image: "quay.io/opstree/redis-exporter:1.0"
    imagePullPolicy: "IfNotPresent"
    resources:
      limits:
        cpu: 100m
        memory: 128Mi
      requests:
        cpu: 100m
        memory: 128Mi
  kubernetesConfig:
    image: "quay.io/opstree/redis:v6.2.5"
    imagePullPolicy: "IfNotPresent"
    resources:
      limits:
        cpu: 100m
        memory: 128Mi
      requests:
        cpu: 100m
        memory: 128Mi
  redisConfig: {}  # <--------------------------- here
  storage:
    volumeClaimTemplate:
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi

And during deploy the last sections overrided the correct one and CRD had no custom config binding set up:

spec:
  kubernetesConfig:
    image: 'quay.io/opstree/redis:v6.2.5'
    imagePullPolicy: IfNotPresent
    resources:
      limits:
        cpu: 100m
        memory: 128Mi
      requests:
        cpu: 100m
        memory: 128Mi
  redisConfig: {}  # <--------------------------- here