-
Notifications
You must be signed in to change notification settings - Fork 313
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
HOSTEDCP-2018: Reorder Nodepool conditions and move nto reconcile logic #4859
base: main
Are you sure you want to change the base?
Conversation
@enxebre: This pull request references HOSTEDCP-1989 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
/hold a bit |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre 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 |
✅ Deploy Preview for hypershift-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@enxebre: This pull request references HOSTEDCP-1976 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.18.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
return reconcilePerformanceProfileConfigMap(performanceProfileConfigMap, nodePool, performanceProfileConfig) | ||
}) | ||
if err != nil { | ||
fmt.Errorf("failed to reconcile PerformanceProfile ConfigMap: %w", err) |
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.
missing return here
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.
thanks! fixed.
53880a3
to
95a1526
Compare
infraID := hcluster.Spec.InfraID | ||
|
||
// Loop over all conditions. | ||
// Order matter as conditions might choose to short circuit returning ctrl.Result or error. | ||
signalConditions := map[string]func(ctx context.Context, nodePool *hyperv1.NodePool, hcluster *hyperv1.HostedCluster, conditionType string) (*ctrl.Result, error){ |
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.
why do we need to pass conditionType to the functions, shouldn't each function know which condition it is updating?
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.
yes, it's not programmatically needed. It seemed easier to grasp at a glance to me what conditions are being applied. They can also be used to unit test everything in the index end up set.
I'm happy to change the approach to something else if you prefer.
_, err := r.getReleaseImage(ctx, hcluster, nodePool.Status.Version, nodePool.Spec.Release.Image) | ||
if err != nil { | ||
SetStatusCondition(&nodePool.Status.Conditions, hyperv1.NodePoolCondition{ | ||
Type: conditionType, |
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.
related to the question above, imo it would be more clear for someone reading those functions later if the condition type is explicitly set here instead of the passed in conditionType parameter.
This centralizes all conditions logic in a sincle place to improve readability. It also enables further changes to add/collapse conditions consistently.
…ot found Since this runs early now, shortcicuiting would never give the token secret the chance to be reconciled
cde7c1a
to
67891b5
Compare
/lgtm |
/retest |
67891b5
to
b5d7b6a
Compare
New changes are detected. LGTM label has been removed. |
b5d7b6a
to
74b0389
Compare
74b0389
to
ee4e243
Compare
@enxebre: The following tests failed, say
Full PR test history. Your PR dashboard. 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. |
@enxebre: This pull request references HOSTEDCP-2018 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, use
fixes #<issue_number>(, fixes #<issue_number>, ...)
format, where issue_number might be a GitHub issue, or a Jira story:Fixes #
Checklist