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 NodePool Provisioning Status Condition Constants #178

Merged

Conversation

tliu2021
Copy link
Collaborator

Use a single condition type for tracking the NodePool provisioning status, with various condition reasons to represent different states in the provisioning process. This simplifies the condition handling by focusing on one type with multiple reasons for clarity and consistency.

Use a single condition type for tracking the NodePool provisioning
status, with various condition reasons to represent different states
in the provisioning process. This simplifies the condition handling
by focusing on one type with multiple reasons for clarity and
consistency.

Signed-off-by: Tao Liu <[email protected]>
@alegacy
Copy link
Contributor

alegacy commented Aug 21, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2024
Copy link

openshift-ci bot commented Aug 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Missxiaoguo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 0927fdd into openshift-kni:main Aug 21, 2024
8 checks passed
Unprovisioned ConditionReason = "Unprovisioned"
Failed ConditionReason = "Failed"
NotInitialized ConditionReason = "NotInitialized"
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

These would be more convenient if setup similar to the condition types and reasons as in:
https://github.com/openshift-kni/oran-o2ims/blob/main/internal/controllers/utils/conditions.go#L8-L48

Something like:

// ConditionReason is a string representing the condition's reason
type ConditionReason string

// The following constants define the different reasons that conditions will be set for the resource
var ResourceConditionReasons = struct {
	Completed  ConditionReason
	InProgress ConditionReason
	Failed     ConditionReason
}{
	Completed:  "Completed",
	InProgress: "InProgress",
	Failed:     "Failed",
}

Rather than a random collection of constants, they're grouped and referenced like:

hwmgmtv1alpha1.ResourceConditionReasons.InProgress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants