Skip to content
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

ArgoCD is not fully reproducing kubectl apply side-effects: not creating a managedFields entry #16813

Open
3 tasks done
reegnz opened this issue Jan 10, 2024 · 1 comment
Open
3 tasks done

Comments

@reegnz
Copy link
Contributor

reegnz commented Jan 10, 2024

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

When doing client-side apply with kubectl, the kubectl client also sets a managedFields entry called kubectl-client-side-apply. This is kept up-to-date to match the kubectl.kubernetes.io/last-applied-configuration.

When starting to move from deploying with kubectl apply to deploying the raw manifests with argocd, the kubectl-client-side-apply field manager is not updated anymore. There's also no other managedFields entry created that says argocd-controller-client-side-apply or similar for example.

To maintain compatibility with kubectl when deploying raw manifests, please make sure that the operation is tracked in managedFields as well, to maintain an element of least surprise.

To Reproduce

cat <<-EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
  name: test
data:
   test: test
EOF

The managed fields is automatically updated:

❯ k get cm test -o yaml --show-managed-fields
apiVersion: v1
data:
  test: test
kind: ConfigMap
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","data":{"test":"test"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"test","namespace":"default"}}
  creationTimestamp: "2024-01-10T13:02:34Z"
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:data:
        .: {}
        f:test: {}
      f:metadata:
        f:annotations:
          .: {}
          f:kubectl.kubernetes.io/last-applied-configuration: {}
    manager: kubectl-client-side-apply
    operation: Update
    time: "2024-01-10T13:02:34Z"
  name: test
  namespace: default
  resourceVersion: "88025"
  uid: 2554be5e-f3b7-4657-b6a1-5a57becc350a

If the same resource is created with ArgoCD, there is no managedFields.

Expected behavior

Whenever argocd creates/updates a resource, a managedFields entry should reflect the same data that the kubectl.kubernetes.io/last-applied-configuration annotation contains.

Version

v2.9.3

@reegnz reegnz added the bug Something isn't working label Jan 10, 2024
@reegnz reegnz changed the title ArgoCD is not reproducing kubectl apply side-effects properly: not creating a managedFields entry ArgoCD is not fully reproducing kubectl apply side-effects: not creating a managedFields entry Jan 10, 2024
@reegnz
Copy link
Contributor Author

reegnz commented Jan 10, 2024

For reference, helm create/update a managedFields entry (with manager name helm) when applying manifests: helm/helm#9870

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

No branches or pull requests

2 participants