Skip to content

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

@fs185143

Description

@fs185143

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions