-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 variable validation to ClusterClass controller, block Cluster reconcile if variables not reconciled #10812
✨ Add variable validation to ClusterClass controller, block Cluster reconcile if variables not reconciled #10812
Conversation
/hold /assign @fabriziopandini @chrischdi |
31758a2
to
e9f51b0
Compare
reconcile if variables not reconciled Signed-off-by: Stefan Büringer [email protected]
e9f51b0
to
c5dfe81
Compare
/test pull-cluster-api-e2e-conformance-ci-latest-main |
/hold cancel |
return ctrl.Result{}, nil | ||
return ctrl.Result{}, errors.Errorf("ClusterClass is not successfully reconciled: ClusterClass.status.observedGeneration must be %d, but is %d", clusterClass.GetGeneration(), clusterClass.Status.ObservedGeneration) | ||
} | ||
if !conditions.Has(clusterClass, clusterv1.ClusterClassVariablesReconciledCondition) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realized that the Cluster topology controller was not block in this case.
Previous behavior was enough for inline variables, because with every change of inline variables generation was changed as well.
But if now variables are coming from a RuntimeExtension just checking the generation is not enough anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
@@ -916,21 +916,22 @@ func (webhook *Cluster) validateClusterClassExistsAndIsReconciled(ctx context.Co | |||
case apierrors.IsNotFound(clusterClassPollErr): | |||
allWarnings = append(allWarnings, | |||
fmt.Sprintf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a bit of manual testing and realized that the warnings should be improved a bit
Thank you for improving variable validation, users messages and unit tests! |
LGTM label has been added. Git tree hash: de81ae7c9699c66cec7b2ecc2822afee76af1daf
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini 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 |
What this PR does / why we need it:
Follow-up to #9239
We should also make sure that variables returned by a Runtime Extension are valid
Example conditions when a Runtime Extension returns an invalid variable schema (I think it's especially nice that multi-line strings are rendered correctly)
ClusterClass:
Cluster
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #