-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
failure with invalid label value #5364
Comments
This is not Argo CD doing this, it is kubernetes. Kubernetes drops the entire labels/annotations if there is one invalid value applied. |
@jessesuen So I probably don't understand everything fully but I thought argocd validates all manifest before being applied? When do I ❯ kubectl apply --server-side=true --dry-run=server -f namespace.yaml
error: unable to decode "namespace.yaml": resource.metadataOnlyObject.ObjectMeta: v1.ObjectMeta.Labels: ReadString: expects " or n, but found 1, error found in #10 byte of ...|label-2":12345},"nam|..., bigger context ...|metadata":{"labels":{"label-1":"12345","label-2":12345},"name":"label-test"}}|... ❯ kubectl apply --dry-run=client -f namespace.yaml
error: unable to decode "namespace.yaml": resource.metadataOnlyObject.ObjectMeta: v1.ObjectMeta.Labels: ReadString: expects " or n, but found 1, error found in #10 byte of ...|label-2":12345},"nam|..., bigger context ...|metadata":{"labels":{"label-1":"12345","label-2":12345},"name":"label-test"}}|... |
The 1.8 has an improvement #1787 . Argo CD used to drop unknown fields - now such fields stay untouched. @strantalis can you please check if upgrade resolves issue? |
@alexmt One thing I noticed is argocd/kube does block a bad label with spaces on sync so not sure whats going on with the integer label value. Seems to be something happening before the sync phase. Maybe when it does the diff? apiVersion: v1
kind: Namespace
metadata:
labels:
argocd.argoproj.io/instance: label-test
label-1: '12345'
spaces: This is invalid
name: label-test
|
Checklist:
argocd version
.Describe the bug
When adding an invalid unquoted numeric label value argocd removes all other labels from the namespace.
To Reproduce
Initial Namespace
Now add a label-2 unquoted. Argocd will show label-1 being removed.
Expected behavior
With this being an invalid label value I would expect argocd to produce an error.
Version
The text was updated successfully, but these errors were encountered: