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 does not accept booleans for conditions #596

Open
tim-jagenberg-piscada opened this issue Jul 21, 2022 · 7 comments
Open

kstatus does not accept booleans for conditions #596

tim-jagenberg-piscada opened this issue Jul 21, 2022 · 7 comments
Labels
needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@tim-jagenberg-piscada
Copy link

Some resources use YAML booleans in their status conditions which are not interpreted by kstatus.

Kstatus should interpret both string and boolean representations for conditions.

For example the new Keycloak Operator uses booleans:

status:
  conditions:
    - message: ''
      status: true
      type: Ready
    - message: ''
      status: false
      type: HasErrors
    - message: ''
      status: false
      type: RollingUpdate

This leads to the resource never being considered reconciled by Flux.

@karlkfi
Copy link
Contributor

karlkfi commented Jul 25, 2022

That seems pretty non-standard. The convention is documented here:
https://github.com/zecke/Kubernetes/blob/master/docs/devel/api-conventions.md#typical-status-properties

They're deliberately strings to allow for "Unknown". In this case, "Unknown" also helps improve the UX and error messages without having to hard code that nil means unknown. It's also a relatively common K8s convention to use string enums instead of booleans, to avoid needing to change the schema if you ever need to add a new enum value.

I would recommend suggesting to keycloak that they follow the standard convention.

That said, I'm not against adding an exception into kstatus for this weird edge case. But I consider it a feature request, not a bug.

@justinsb what do you think?

@tim-jagenberg-piscada
Copy link
Author

I also reported the issue on the Keycloak side as well: keycloak/keycloak#13074

Making kstatus more robust against probable variations in input would be good anyhow.

@k8s-triage-robot
Copy link

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

This bot triages issues and PRs 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 or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR 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 Oct 25, 2022
@k8s-triage-robot
Copy link

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

This bot triages issues and PRs 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 or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR 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 Nov 24, 2022
@karlkfi karlkfi added approved Indicates a PR has been approved by an approver from all required OWNERS files. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 29, 2022
@thezanke
Copy link

thezanke commented Apr 13, 2023

I'd love to see either a fix on keycloak's side or this feature added to kstatus so my resources can play well together without a bunch of manual workarounds.

If it helps grease the wheels of value here, eksctl is the official AWS-suggested way to spin up new EKS clusters. Also, eksctl now ships with partial support for setting up GitOps with Flux2 out of the box; so you'll only be hearing/seeing more of this from EKS users.

Thanks.

@nick4fake
Copy link

@karlkfi Tim suggested supporting both boolean and strings, I don't see how it really affects "Unknown".

I mean, it even makes much more sense - why does it use "True"/"False" strings now, but doesn't support booleans? The check should probably be trivial:

  • If bool: return status ? "True" : "False"
  • else return status

@k8s-triage-robot
Copy link

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

6 participants