Open orondon opened 2 years ago
I just ran into this myself.
Except, for me, I was adding a boolean, not a numeric. unquoted.
apiVersion: v1
kind: Namespace
metadata:
name: 14west-iris-plus-dev
labels:
cost-tenancy: Dedicated
dept: Development
org: WMC
network-share: iris-plus
newrelic-metadata-injection: enabled
14west.io/patch-ingress-route: true
Once I quoted the boolean, it recognized all of the labels, otherwise, it saw none and removed the labels on a sync.
This issue still happening in 2.6.3. For me its boolean and quoting is not helping.
We experience the same issue, using version - 2.6.2 We use numeric values, and quoting does help to fix the issue.
Slack Ref. https://cloud-native.slack.com/archives/C01TSERG0KZ/p1651577780669539
Checklist:
argocd version
.Describe the bug
We are using ArgoCD to provision resources in RedHat Openshift Cluster Platform 4.6 and 4.8 clusters via HelmCharts (Git HelmChart -> ArgoCD -> OCP) One of the resources we provision are namespaces, which contained several namespace string labels. We added one numeric label (unquoted numeric value) as the k8s spec for namespace labels indicates support of alphanumeric values (https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/), but this caused ArgoCD to invalidate all the labels field and removed all pre-existing string labels.
To Reproduce
Create a namespace in k8s via ArgoCD with additional custom string labels We use this template on the helm chart
With these values:
So we obtain a live manifest:
Add a new unquoted numeric label Updating the values:
Validate labels in OCP and ArgoCD This is the live manifest
and the desired manifest:
No diff, and no event on Argo. Previous labels (project, tenant, app, env) were removed in ArgoCD and OCP.
If we introduce the numeric label as string by quoting it the labels are correctly applied.
Expected behavior
Expected behavior is:
Screenshots
Version Reproducible in both versions below:
and
and in OCP 4.6 and 4.8
Logs
ArgoCD did not show any event messages.