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

bug(ssa): allow changes to only metadata.ownerReferences #781

Open
fs185143 opened this issue Jun 17, 2024 · 0 comments
Open

bug(ssa): allow changes to only metadata.ownerReferences #781

fs185143 opened this issue Jun 17, 2024 · 0 comments

Comments

@fs185143
Copy link

If an object exists on the cluster in this state:

apiVersion: policy.linkerd.io/v1alpha1
kind: NetworkAuthentication
metadata:
  name: node-network
  namespace: emissary
  ownerReferences:
    - apiVersion: someapi.io/v1
      kind: SomeResource
      name: test1
      uid: <uid>
spec:
  networks:
  - cidr: "0.0.0.0"

And I want to update it to add an additional owner reference via ssa (without changing anything else), then I should be able to update it such that it becomes:

apiVersion: policy.linkerd.io/v1alpha1
kind: NetworkAuthentication
metadata:
  name: node-network
  namespace: emissary
  ownerReferences:
    - apiVersion: someapi.io/v1
      kind: SomeResource
      name: test1
      uid: <uid>
    - apiVersion: someapi.io/v1
      kind: SomeResource
      name: test2
      uid: <uid>
spec:
  networks:
  - cidr: "0.0.0.0"

However, applying a resource via ssa (using Force: true or otherwise) where only the metadata changes causes the resource to not be patched.

I think it may be derived from this line where the metadata is removed from any comparison

unstructured.RemoveNestedField(deepCopy.Object, "metadata")

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

No branches or pull requests

1 participant