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

add Ready condition to Management resources #960

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

ramessesii2
Copy link
Contributor

@ramessesii2 ramessesii2 commented Jan 26, 2025

What

This PR introduces a Ready Condition and new printer columns in the Management CRD making it possible to look at the readiness of Management object at a glance along with release version.

✅ Unit Tests
Fixes #807

Kubectl gets the following:

kubeclt get management -w
NAME   READY   RELEASE     AGE
kcm    False       kcm-0-0-7   22s
kcm    False       kcm-0-0-7   3m54s
kcm    False       kcm-0-0-7   4m24s
kcm    True        kcm-0-0-7   4m34s
Click to check an example Status generated
status:
  availableProviders:
  - bootstrap-k0sproject-k0smotron
  - control-plane-k0sproject-k0smotron
  - infrastructure-aws
  - infrastructure-azure
  - infrastructure-internal
  - infrastructure-k0sproject-k0smotron
  - infrastructure-openstack
  - infrastructure-vsphere
  capiContracts:
    bootstrap-k0sproject-k0smotron:
      v1beta1: v1beta1
    control-plane-k0sproject-k0smotron:
      v1beta1: v1beta1
    infrastructure-aws:
      v1alpha3: v1alpha3
      v1alpha4: v1alpha4
      v1beta1: v1beta1_v1beta2
    infrastructure-azure:
      v1beta1: v1beta1
    infrastructure-k0sproject-k0smotron:
      v1beta1: v1beta1
    infrastructure-openstack:
      v1beta1: v1beta1
    infrastructure-vsphere:
      v1beta1: v1beta1
  components:
    capi:
      success: true
      template: cluster-api-0-0-6
    cluster-api-provider-aws:
      success: true
      template: cluster-api-provider-aws-0-0-4
    cluster-api-provider-azure:
      success: true
      template: cluster-api-provider-azure-0-0-4
    cluster-api-provider-openstack:
      success: true
      template: cluster-api-provider-openstack-0-0-1
    cluster-api-provider-vsphere:
      success: true
      template: cluster-api-provider-vsphere-0-0-5
    k0smotron:
      success: true
      template: k0smotron-0-0-6
    kcm:
      success: true
      template: kcm-0-0-7
    projectsveltos:
      success: true
      template: projectsveltos-0-45-0
  conditions:
  - lastTransitionTime: "2025-01-26T19:51:47Z"
    message: All components are successfully installed.
    observedGeneration: 1
    reason: AllComponentsHealthy
    status: "True"
    type: Ready
  observedGeneration: 1
  release: kcm-0-0-7

@ramessesii2 ramessesii2 force-pushed the RAMESSES/management-conditions branch 2 times, most recently from 2e2be83 to 86a767a Compare January 27, 2025 05:39
@ramessesii2 ramessesii2 marked this pull request as ready for review January 27, 2025 06:05
zerospiel
zerospiel previously approved these changes Jan 27, 2025
Copy link
Contributor

@zerospiel zerospiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but someone else should review

api/v1alpha1/management_types.go Outdated Show resolved Hide resolved
@ramessesii2 ramessesii2 force-pushed the RAMESSES/management-conditions branch 4 times, most recently from 96328cb to 8fcefa0 Compare January 27, 2025 13:50
@ramessesii2 ramessesii2 force-pushed the RAMESSES/management-conditions branch 2 times, most recently from 5d986b5 to c48f3de Compare January 27, 2025 14:35
Copy link
Contributor

@eromanova eromanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. I’ve left one comment for consideration.

internal/controller/management_controller.go Show resolved Hide resolved
Signed-off-by: Satyam Bhardwaj <sbhardwaj@mirantis.com>
@ramessesii2 ramessesii2 force-pushed the RAMESSES/management-conditions branch from c48f3de to 60e4ff4 Compare January 27, 2025 14:59
@zerospiel zerospiel merged commit c486cd1 into k0rdent:main Jan 27, 2025
6 checks passed
@ramessesii2 ramessesii2 deleted the RAMESSES/management-conditions branch January 28, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[enhancement] Add status condition to Management object to make it kstate-compatible
3 participants