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

Ready condition does not aggregate status value from other conditions #693

Open
dmvolod opened this issue Jan 28, 2025 · 1 comment
Open
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@dmvolod
Copy link
Member

dmvolod commented Jan 28, 2025

What steps did you take and what happened:
Create namespace capi-system

kubectl create ns capi-system

Create a simple CoreProvider configuration

apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
  name: cluster-api
  namespace: capi-system
spec:
  version: v1.8.5

Waiting for provider to be installed

kubectl wait --for=condition=Ready coreprovider/cluster-api -n capi-system

Patch CoreProvider object and downgrade version to emulated situation

kubectl patch coreproviders.operator.cluster.x-k8s.io cluster-api --type='json' -p='[{"op": "replace", "path": "/spec/version", "value":"v1.7.4"}]' -n capi-system

Right now, Ready will be always True, but PreflightCheckPassed will be false.

11:43 $ kubectl get coreprovider -A
NAMESPACE     NAME          INSTALLEDVERSION   READY
capi-system   cluster-api   v1.8.1             True
apiVersion: operator.cluster.x-k8s.io/v1alpha2
kind: CoreProvider
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"operator.cluster.x-k8s.io/v1alpha2","kind":"CoreProvider","metadata":{"annotations":{},"name":"cluster-api","namespace":"capi-system"},"spec":{"version":"v1.8.5"}}
    operator.cluster.x-k8s.io/applied-spec-hash: ""
  creationTimestamp: "2025-01-28T04:56:40Z"
  finalizers:
  - provider.cluster.x-k8s.io
  generation: 5
  name: cluster-api
  namespace: capi-system
  resourceVersion: "43118"
  uid: 429e4f13-c6d5-4b52-a5a0-13e99c9ce831
spec:
  version: v1.7.4
status:
  conditions:
  - lastTransitionTime: "2025-01-28T04:58:45Z"
    reason: MinimumReplicasAvailable
    status: "True"
    type: Ready
  - lastTransitionTime: "2025-01-28T08:43:13Z"
    message: Downgrade is not supported for provider cluster-api
    reason: UnsupportedProviderDowngradeReason
    severity: Error
    status: "False"
    type: PreflightCheckPassed
  - lastTransitionTime: "2025-01-28T04:56:50Z"
    status: "True"
    type: ProviderInstalled
  - lastTransitionTime: "2025-01-28T04:58:25Z"
    status: "True"
    type: ProviderUpgraded
  contract: v1beta1
  installedVersion: v1.8.1
  observedGeneration: 4

What did you expect to happen:
I expect, that aggregated Ready condition will be False as in common approach, operator can't apply resource to the target conditions with a new version or others preflight check validations.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
It would be nice to validate situations like this ASAP for any cases. I will create a separate issue related to integrate preflight checks inside the web-hook validation logic.

Environment:

  • Cluster-api-operator version: v0.15.1
  • Cluster-api version:
  • Minikube/KIND version: KinD
  • Kubernetes version: (use kubectl version): v1.29.2
  • OS (e.g. from /etc/os-release): fedora

/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-operator/labels?q=area for the list of labels]

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 28, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If CAPI Operator contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@dmvolod dmvolod changed the title Ready condition does not aggregate status value from the PreflightCheckPassed condition Ready condition does not aggregate status value from the other conditions Jan 29, 2025
@dmvolod dmvolod changed the title Ready condition does not aggregate status value from the other conditions Ready condition does not aggregate status value from other conditions Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants