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

kstatus: defaults to fail open when no status field is available #632

Open
jack1902 opened this issue Oct 20, 2023 · 7 comments
Open

kstatus: defaults to fail open when no status field is available #632

jack1902 opened this issue Oct 20, 2023 · 7 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@jack1902
Copy link

TL;DR - When a resource doesn't yet have a status field does kstatus report unknown ?

When creating a resource which is defined by a CRD which has no status by default, i believe the behaviour of kstatus is to state "unknown". I believe this then enables developers using unknown as a condition to determine if that should be seen as "lets carry on" or "stop here and wait".

If the "unknown" status is indeed what happens when no status field exists on a resource (because it has been freshly applied and the backing controller hasn't had a chance to update the CR' status field yet, i'll close this issue and raise another with the project using this one to add configuration.

@Raffo
Copy link

Raffo commented Oct 23, 2023

One thing that we have been doing is to patch the logic for every custom CRD that we create. It's not great, but we also don't have a lot of custom CRDs.

@aw185176
Copy link

When a resource doesn't yet have a status field does kstatus report unknown ?

If I am reading the code right (

func Compute(u *unstructured.Unstructured) (*Result, error) {
), it actually falls all the way through to Current if there is no status field.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 21, 2024
@Raffo
Copy link

Raffo commented Apr 4, 2024

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 4, 2024
@karlkfi
Copy link
Contributor

karlkfi commented Jul 2, 2024

When a resource doesn't yet have a status field does kstatus report unknown ?

If I am reading the code right (

func Compute(u *unstructured.Unstructured) (*Result, error) {

), it actually falls all the way through to Current if there is no status field.

This is correct. Objects without status are assumed to be Current. This is how many of the base k8s types are handled, like Role & RoleBinding, which don't have status.

If you want your CRD to not immediately be seen as Current, add status.observedGeneration to the schema with a default of 0. This will cause the API Server to create a default status when the object is created, which kstatus will interpret as InProgress until your controller sets status.observedGeneration = meta.generation.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 30, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants