argoproj / argo-helm

ArgoProj Helm Charts
https://argoproj.github.io/argo-helm/
Apache License 2.0
1.78k stars 1.88k forks source link

dex can't evaluate field labelSelector in type interface {} #2250

Closed FernandoMiguel closed 1 year ago

FernandoMiguel commented 1 year ago

Describe the bug

│ Error: template: argo-cd/templates/dex/deployment.yaml:176:32: executing "argo-cd/templates/dex/deployment.yaml" at <$constraint.labelSelector>: can't evaluate field labelSelector in type interface {}
│
│   with module.argo_cd.module.eks_blueprints_kubernetes_addons_argo_cd.module.helm_addon.helm_release.addon[0],
│   on .terraform/modules/argo_cd.eks_blueprints_kubernetes_addons_argo_cd/modules/kubernetes-addons/helm-addon/main.tf line 1, in resource "helm_release" "addon":
│    1: resource "helm_release" "addon" {

values.yaml


[...]
## Dex
dex:
  topologySpreadConstraints:
    maxSkew: 1
    topologyKey: topology.kubernetes.io/zone
    whenUnsatisfiable: ScheduleAnyway

  metrics:
    # -- Deploy metrics service
    enabled: true

  # Argo CD init image that creates Dex config
  initImage:
    resources:
      requests:
        cpu: 5m
        memory: 128Mi
      limits:
        #  cpu: 10m
        memory: 144Mi

  # -- Resource limits and requests for dex
  resources:
    requests:
      cpu: 10m
      memory: 128Mi
    limits:
      #  cpu: 50m
      memory: 128Mi
[...]

### Related helm chart

argo-cd

### Helm chart version

5.45.1

### To Reproduce

update from 5.38.x to 5.45.1 and add `topologySpreadConstraints` and higher `resources`

### Expected behavior

the chart to deploy correctly

### Screenshots

_No response_

### Additional context

_No response_
yu-croco commented 1 year ago

Hi @FernandoMiguel topologySpreadConstraints is supposed to be list. Ref: https://github.com/argoproj/argo-helm/blob/main/charts/argo-cd/values.yaml#L1118

So I think this is supposed to be like below. It worked on my local.

dex:
  topologySpreadConstraints:
-   maxSkew: 1
-   topologyKey: topology.kubernetes.io/zone
-   whenUnsatisfiable: ScheduleAnyway
+   - maxSkew: 1
+     topologyKey: topology.kubernetes.io/zone
+     whenUnsatisfiable: ScheduleAnyway
FernandoMiguel commented 1 year ago

thanks @yu-croco for spotting that. spent a couple hours staring at this and didn't see it. cheers