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

Status not updating despite --update-status #555

Closed
TrueBrain opened this issue Mar 23, 2021 · 3 comments · Fixed by #558 or #567
Closed

Status not updating despite --update-status #555

TrueBrain opened this issue Mar 23, 2021 · 3 comments · Fixed by #558 or #567

Comments

@TrueBrain
Copy link
Contributor

TrueBrain commented Mar 23, 2021

First of all, I know very little about how CRDs etc work, so take the following with a salt of grain.
Running k3os with GitVersion:"v1.19.5+k3s2".

When I enable --update-status, my SealedSecret objects still weren't getting the Status field. I checked everything as in:

  • Checked the Go-code was really updating the status: it was
  • Checked the argument was really set: it was
  • Checked that the status update was send: it was (I revoked the permission, and it was giving an error)
  • Checked k3s (which I am using) doesn't magically not support subresources or something: that was not the issue.

In the end, by looking how others did it (longhorn in my case), I found that the openAPIV3Schema doesn't set the magic x-kubernetes-preserve-unknown-fields to true for status. After doing this, it magically works!

      openAPIV3Schema:
        properties:
          spec:
            type: object
            x-kubernetes-preserve-unknown-fields: true
          status:
            x-kubernetes-preserve-unknown-fields: true
        type: object

I have no clue why this would be the case etc etc, and I am sure you guys will know a lot better what is going on here, but without that addition, I cannot get this to work at all.

Am I right that the schema definition is wrong, or am I just doing something else wrong?

Tnx!

@TrueBrain TrueBrain changed the title Status not update despite --update-status Status not updating despite --update-status Mar 23, 2021
@jsoref
Copy link
Contributor

jsoref commented Mar 23, 2021

Thanks, applying this change fixes it for our ArgoCD-helm managed sealed-secrets deployments.

@dbyron0
Copy link
Contributor

dbyron0 commented Mar 24, 2021

This helped me, so perhaps it'll help others too: argoproj/argo-rollouts#1044 (comment)

@iamnoah
Copy link

iamnoah commented Apr 1, 2021

kustomize patch if anyone else needs this before the PR is merged and released:

# makes --update-status work: https://github.com/bitnami-labs/sealed-secrets/issues/555
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: sealedsecrets.bitnami.com
spec:
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        properties:
          spec:
            type: object
            x-kubernetes-preserve-unknown-fields: true
          status:
            x-kubernetes-preserve-unknown-fields: true
        type: object
    served: true
    storage: true
    subresources:
      status: {}

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