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

Patch existing resource in merge patch way #57

Closed
kertzi opened this issue Aug 23, 2022 · 1 comment · Fixed by #246
Closed

Patch existing resource in merge patch way #57

kertzi opened this issue Aug 23, 2022 · 1 comment · Fixed by #246
Labels
enhancement New feature or request

Comments

@kertzi
Copy link

kertzi commented Aug 23, 2022

Scenario:
I have EKS cluster and I need to update aws-node daemonset environment variable.
I try to do it with following Object definition, this is part of composition:

  - name: aws-node-daemonset
    base:
      apiVersion: kubernetes.crossplane.io/v1alpha1
      kind: Object
      spec:
        managementPolicy: ObserveCreateUpdate
        providerConfigRef:
          name: kubernetes-provider
        forProvider:
          manifest:
            apiVersion: apps/v1
            kind: DaemonSet
            metadata:
              name: aws-node
              namespace: kube-system
            spec:
              template:
                spec:
                  containers:
                  - env:
                    - name: ENABLE_PREFIX_DELEGATION
                      value: "true"
                    name: aws-node

Result is that I get error update failed: cannot apply object: cannot patch object: DaemonSet.apps "aws-node" is invalid: spec.template.spec.containers[0].image: Required value

So it looks like I have to add complete daemonset definition to make it work but that's not optimal, I just want to modify existing a little bit.
Is there anyway to do some kind of "merge patch" to existing kubernetes object? I think that way this could work

@kertzi kertzi added the enhancement New feature or request label Aug 23, 2022
@turkenh
Copy link
Collaborator

turkenh commented Aug 23, 2023

Could you try with SSA and see if helps? #134

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

Successfully merging a pull request may close this issue.

2 participants