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

Any reason not set status as subresource by default #1438

Closed
vincent-pli opened this issue Mar 20, 2020 · 4 comments · Fixed by #1484
Closed

Any reason not set status as subresource by default #1438

vincent-pli opened this issue Mar 20, 2020 · 4 comments · Fixed by #1484
Assignees
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@vincent-pli
Copy link
Contributor

I wonder to know the reason behind that: not set status as subresource by default.
The operator-sdk set it after add new api.

I struggle it for several hours when I try to use client.status().update in reconscile, until I found status 's subresource is not enable, thanks.

/triage support

@vincent-pli vincent-pli added the kind/support Categorizes issue or PR as a support question. label Mar 20, 2020
@sarweshsuman
Copy link

Hi @vincent-pli , i am facing same issue. How did you enabled status as subresource ?

@vincent-pli
Copy link
Contributor Author

@sarweshsuman
Add comment:
// +kubebuilder:subresource:status
to your api difinition like this:

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status

// Foo is the sample API
type Foll struct {

@camilamacedo86
Copy link
Member

Note. that according to its docs:

CRDs can choose to implement the /status and /scale subresources as of Kubernetes 1.13.

It’s generally recommended that you make use of the /status subresource on all resources that have a status field.
Ref: https://book.kubebuilder.io/reference/generating-crd.html#subresources

So, I agree with you that by default we could scaffold the recommendation. Doing PR for it. Let's see what the others think about.

@camilamacedo86
Copy link
Member

/assign @camilamacedo86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants