Skip to content

require working maestro reading to consider cluster create successful - #4695

Merged
openshift-merge-bot[bot] merged 5 commits into
mainfrom
cs-150-require-maestro
Apr 28, 2026
Merged

require working maestro reading to consider cluster create successful#4695
openshift-merge-bot[bot] merged 5 commits into
mainfrom
cs-150-require-maestro

Conversation

@deads2k

Copy link
Copy Markdown
Collaborator

New cluster have to pass a check of the HostedCluster itself to confirm that they are working. This is currently in addition to cluster-service. Eventually we will remove the check of cluster-service consistency.

Comment thread sessiongate/go.mod Outdated
Comment thread admin/server/go.mod Outdated
Comment thread backend/pkg/listers/management_cluster_content_lister.go Outdated
Comment thread internal/api/types_management_cluster_content.go
Comment thread sessiongate/go.mod Outdated
}
}

var provisioningStatePriority = map[arm.ProvisioningState]int{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the idea of this that there are states from different areas/resources being calculated, and we want to only return one, and we define this to define which one we return when there are "competing/different" states between the resources?

What was the criteria on deciding the priority? I understand that we want to give priority to failure cases vs succeed cases but there are some where the line is a bit more gray like updating, accepted, provisioning

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes that is the idea. The priority is chosen based on, "which status is most useful for customers".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Will add a comment into the code.

if err := errors.Join(errs...); err != nil {
return nil, err
}
if len(operationStates) == 0 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this check needed? i there were errors the check in line 226 should occur and return. If there were no errors we are guaranteed to have at least one element.

return nil, errors.New("empty provisioning state")
}

return operationStates[0], nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Because here we return the state with the most priority (lower integer number), should we add some logging so we can see the N states calculated to aid with debugging?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

good point, will add.

}

slices.SortStableFunc(operationStates, compareOperationState)
if operationStates[0] == nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can an operationState in the array be nil?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

people will mess up.

if operationStates[0] == nil {
return nil, errors.New("nil operation state")
}
if len(operationStates[0].provisioningState) == 0 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can an operationState provisioningState be empty?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

its' not desired, but I had a couple accidents.

continue
}
currMajorMinor := fmt.Sprintf("%d.%d", currVersion.Major, currVersion.Minor)
if minVersion, ok := minVersionsWithValidSuccessCondition[currMajorMinor]; ok && currVersion.LT(minVersion) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you expand on the meaning of the map, and the usage of sentinel values? I am trying to understand its purpose.

}

if anyVersionWithValidSuccessCondition {
// can only check this when the success condition works, because this is unreliable otherwise

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can the HostedClusterAvailable condition be true if there hasn't been any control plane version completed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Maybe. This is only used to report provisioning, not success.

}
}

if len(hostedCluster.Status.ControlPlaneEndpoint.Host) == 0 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is ControlPlaneEndpoint the same as the K8s API URL that we store in the ServiceProviderCluster (.api.url) ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not sure, but I figure so. Seems like we should have one.

@deads2k
David Eads (deads2k) force-pushed the cs-150-require-maestro branch 3 times, most recently from 283d15a to 9b1e8ad Compare April 24, 2026 22:17
@miguelsorianod

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci

openshift-ci Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, miguelsorianod

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

The pull request process is described here

Details 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-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 541a3a7 and 2 for PR HEAD 3a0b8ba in total

@deads2k

Copy link
Copy Markdown
Collaborator Author

/retest

@openshift-ci

openshift-ci Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

David Eads (@deads2k): The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/secrets-validation 6daf8c1 link true /test secrets-validation
ci/prow/images-push 164ac19 link true /test images-push
ci/prow/cspr 164ac19 link true /test cspr

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@sclarkso

Copy link
Copy Markdown
Collaborator

/test e2e-parallel

@openshift-merge-bot
openshift-merge-bot Bot merged commit a081fa3 into main Apr 28, 2026
15 checks passed
@openshift-merge-bot
openshift-merge-bot Bot deleted the cs-150-require-maestro branch April 28, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants