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

Drop kas call in agent ReconcileCAPIInfraCR and fail if no ign #1469

Merged
merged 1 commit into from Jun 17, 2022

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Jun 17, 2022

What this PR does / why we need it:
This add unit tests and fixes the ReconcileCAPIInfraCR agent implementation to avoid an unncesesary kas call to fetch the HCP, since all needed info is available already.

Aditionally it returns early if there's no ign endpoint to ensure we create the agentCluster only after ignition endpoint exists so AgentClusterInstall is only created with the right ign to boot machines.
https://bugzilla.redhat.com/show_bug.cgi?id=2097895
https://github.com/openshift/assisted-service/blob/241ad46db74add5f16e153f5f7ba0a5496fb06ba/pkg/validating-webhooks/hiveextension/v1beta1/agentclusterinstall_admission_hook.go#L185
https://github.com/openshift/cluster-api-provider-agent/blob/master/controllers/agentcluster_controller.go#L126
This change honours the following statement:
For AgentClusterInstall/ClusterDeployment if the input is empty, the value is defaulted so the field is optional and immutable. For CAPI is effectively required and immutable.

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

openshift-ci bot commented Jun 17, 2022

[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 Jun 17, 2022
@netlify
Copy link

netlify bot commented Jun 17, 2022

Deploy Preview for hypershift-docs ready!

Name Link
🔨 Latest commit cbfb6f2
🔍 Latest deploy log https://app.netlify.com/sites/hypershift-docs/deploys/62ac3850e3634f000930c881
😎 Deploy Preview https://deploy-preview-1469--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 settings.

@enxebre
Copy link
Member Author

enxebre commented Jun 17, 2022

If we don't want to return early when there's no ignition I'll update the PR so still add unit tests and save the unnecessary kas call cc @eranco74 @avishayt

@avishayt
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2022
This add unit tests and fixes the ReconcileCAPIInfraCR agent implementation to avoid an unncesesary kas call to fetch the HCP, since all needed info is available already.
Aditionally it returns early if there's no ign endpoint to ensure we create the agentCluster only after ignition endpoint exists so AgentClusterInstall is only created with the right ign to boot machines.
https://bugzilla.redhat.com/show_bug.cgi?id=2097895
https://github.com/openshift/assisted-service/blob/241ad46db74add5f16e153f5f7ba0a5496fb06ba/pkg/validating-webhooks/hiveextension/v1beta1/agentclusterinstall_admission_hook.go#L185
https://github.com/openshift/cluster-api-provider-agent/blob/master/controllers/agentcluster_controller.go#L126
@enxebre enxebre force-pushed the agent-ReconcileCAPIInfraCR branch from cbfb6f2 to 9a0308a Compare June 17, 2022 08:33
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 17, 2022

New changes are detected. LGTM label has been removed.

@enxebre enxebre added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2022
@enxebre
Copy link
Member Author

enxebre commented Jun 17, 2022

/hold
for @csrwng and @sjenning to cancel

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2022
@csrwng
Copy link
Contributor

csrwng commented Jun 17, 2022

/hold cancel
/lgtm

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2022
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 2 against base HEAD 069d7d1 and 8 for PR HEAD 9a0308a in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 17, 2022

@enxebre: The following test 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/capi-provider-agent-sanity 9a0308a link false /test capi-provider-agent-sanity

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

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.

None yet

4 participants