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

HOSTEDCP-2018: Reorder Nodepool conditions and move nto reconcile logic #4859

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Oct 8, 2024

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 8, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 8, 2024

@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:

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

@enxebre
Copy link
Member Author

enxebre commented Oct 8, 2024

/hold a bit

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/needs-area labels Oct 8, 2024
@openshift-ci openshift-ci bot added area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels Oct 8, 2024
Copy link
Contributor

openshift-ci bot commented Oct 8, 2024

[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 /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 Oct 8, 2024
Copy link

netlify bot commented Oct 8, 2024

Deploy Preview for hypershift-docs ready!

Name Link
🔨 Latest commit 53880a3
🔍 Latest deploy log https://app.netlify.com/sites/hypershift-docs/deploys/6704fd8f844f91000895342c
😎 Deploy Preview https://deploy-preview-4859--hypershift-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@enxebre enxebre changed the title HOSTEDCP-1989: Reorder Nodepool conditions and move nto reconcile logic HOSTEDCP-1989 / HOSTEDCP-1976: Reorder Nodepool conditions and move nto reconcile logic Oct 8, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 8, 2024

@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:

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

missing return here

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks! fixed.

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){
Copy link
Contributor

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?

Copy link
Member Author

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,
Copy link
Contributor

@muraee muraee Oct 8, 2024

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
@muraee
Copy link
Contributor

muraee commented Oct 8, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2024
@enxebre
Copy link
Member Author

enxebre commented Oct 9, 2024

eventually.go:379: observed invalid **v1beta1.NodePool state after 10m0s
eventually.go:396: - observed **v1beta1.NodePool e2e-clusters-blx2m/example-cvjf7-test-ntoperformanceprofile invalid: condition performance.operator.openshift.io/Available is not present

/retest

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 9, 2024
Copy link
Contributor

openshift-ci bot commented Oct 9, 2024

New changes are detected. LGTM label has been removed.

Copy link
Contributor

openshift-ci bot commented Oct 10, 2024

@enxebre: 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/e2e-aws-4-17 ee4e243 link true /test e2e-aws-4-17
ci/prow/e2e-aws ee4e243 link true /test e2e-aws

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 enxebre changed the title HOSTEDCP-1989 / HOSTEDCP-1976: Reorder Nodepool conditions and move nto reconcile logic HOSTEDCP-2018: Reorder Nodepool conditions and move nto reconcile logic Oct 14, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 14, 2024

@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:

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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

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. area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants