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

OCPBUGS-7076: Copy Day2 BMH if Agent is installing #5250

Merged
merged 1 commit into from Jun 7, 2023

Conversation

CrystalChun
Copy link
Contributor

OCPBUGS-7076
Previously the BMAC would copy the BMH and
Machine CRs of a Day2 worker to the spoke cluster before
the Agent began installing. If the Agent doesn't
start installing within the two hours these CRs
were copied over, the CSRs for these nodes will
not be approved by the machine approver pod.

To prevent this from happening, only copy
the BMH and Machine CRs to the spoke cluster
when the Agent has started installing.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

/cc @eranco74

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 27, 2023
@openshift-ci openshift-ci bot requested a review from eranco74 May 27, 2023 00:48
@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label May 27, 2023
@openshift-ci-robot
Copy link

@CrystalChun: This pull request references Jira Issue OCPBUGS-7076, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

OCPBUGS-7076
Previously the BMAC would copy the BMH and
Machine CRs of a Day2 worker to the spoke cluster before
the Agent began installing. If the Agent doesn't
start installing within the two hours these CRs
were copied over, the CSRs for these nodes will
not be approved by the machine approver pod.

To prevent this from happening, only copy
the BMH and Machine CRs to the spoke cluster
when the Agent has started installing.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

/cc @eranco74

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.

https://issues.redhat.com/browse/OCPBUGS-7076
Previously the BMAC would copy the BMH and Machine
CRs of a Day2 worker to the spoke cluster before
the Agent began installing. If the Agent doesn't
start installing within the two hours these CRs
were copied over, the CSRs for these nodes will
not be approved by the machine approver pod.

To prevent this from happening, only copy
the BMH and Machine CRs to the spoke cluster
when the Agent has started installing.
@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 27, 2023
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 27, 2023
@codecov
Copy link

codecov bot commented May 27, 2023

Codecov Report

Merging #5250 (8ae647f) into master (43219b9) will increase coverage by 1.44%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5250      +/-   ##
==========================================
+ Coverage   67.46%   68.91%   +1.44%     
==========================================
  Files         218      221       +3     
  Lines       32714    35497    +2783     
==========================================
+ Hits        22072    24462    +2390     
- Misses       8656     8915     +259     
- Partials     1986     2120     +134     
Impacted Files Coverage Δ
...nal/controller/controllers/bmh_agent_controller.go 74.88% <100.00%> (+0.08%) ⬆️

... and 27 files with indirect coverage changes

@avishayt
Copy link
Contributor

Why not wait until the node is fully installed? What happens if the installation itself takes more than 2-3 hours (for example, a long time to pull images, or the host booted into the wrong disk and it took time to address)?

@CrystalChun
Copy link
Contributor Author

Why not wait until the node is fully installed? What happens if the installation itself takes more than 2-3 hours (for example, a long time to pull images, or the host booted into the wrong disk and it took time to address)?

@avishayt Thank you for the feedback!

I've tested this out by only checking for HostStatusInstalled, as suggested, and observed that the Agent gets stuck in Rebooting with the state installing-pending-user-action. The install never completes.

The spoke cluster's machine approver pod errors out with

E0602 00:52:57.290085       1 csr_check.go:263] csr-xbfck: failed to find machine for node extraworker-1, cannot approve
I0602 00:52:57.290119       1 controller.go:233] csr-xbfck: CSR not authorized

where extraworker-1 is my day 2 worker node that never gets installed.

Please correct me if I'm wrong, but it seems like copying the BMH & Machine of the day 2 worker node must be done while the Agent is in the installing phase. Otherwise, the CSR will never be approved and the installation will never complete.

Copy link
Contributor

@avishayt avishayt left a comment

Choose a reason for hiding this comment

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

Your PR looks good - sorry for the noise. It slipped my mind that we won't set the status to installed until the node is Ready, and that won't happen until the CSR is approved.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 4, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jun 4, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: avishayt, CrystalChun

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:
  • OWNERS [CrystalChun,avishayt]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@CrystalChun
Copy link
Contributor Author

Your PR looks good - sorry for the noise. It slipped my mind that we won't set the status to installed until the node is Ready, and that won't happen until the CSR is approved.

No problem! Thank you again for the review!

@CrystalChun
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jun 6, 2023
@openshift-ci-robot
Copy link

@CrystalChun: This pull request references Jira Issue OCPBUGS-7076, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.0) matches configured target version for branch (4.14.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @chadcrum

In response to this:

/jira refresh

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.

@openshift-ci openshift-ci bot requested a review from chadcrum June 6, 2023 23:17
@openshift-ci
Copy link

openshift-ci bot commented Jun 7, 2023

@CrystalChun: all tests passed!

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.

@openshift-merge-robot openshift-merge-robot merged commit 46865f2 into openshift:master Jun 7, 2023
15 checks passed
@openshift-ci-robot
Copy link

@CrystalChun: Jira Issue OCPBUGS-7076: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-7076 has been moved to the MODIFIED state.

In response to this:

OCPBUGS-7076
Previously the BMAC would copy the BMH and
Machine CRs of a Day2 worker to the spoke cluster before
the Agent began installing. If the Agent doesn't
start installing within the two hours these CRs
were copied over, the CSRs for these nodes will
not be approved by the machine approver pod.

To prevent this from happening, only copy
the BMH and Machine CRs to the spoke cluster
when the Agent has started installing.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

/cc @eranco74

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.

@CrystalChun
Copy link
Contributor Author

/cherry-pick release-ocm-2.7

@openshift-cherrypick-robot

@CrystalChun: new pull request created: #5283

In response to this:

/cherry-pick release-ocm-2.7

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.

@CrystalChun
Copy link
Contributor Author

/cherry-pick release-ocm-2.8

@openshift-cherrypick-robot

@CrystalChun: new pull request created: #5286

In response to this:

/cherry-pick release-ocm-2.8

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.

CrystalChun added a commit to CrystalChun/assisted-service that referenced this pull request Jun 7, 2023
https://issues.redhat.com/browse/OCPBUGS-7076
Previously the BMAC would copy the BMH and Machine
CRs of a Day2 worker to the spoke cluster before
the Agent began installing. If the Agent doesn't
start installing within the two hours these CRs
were copied over, the CSRs for these nodes will
not be approved by the machine approver pod.

To prevent this from happening, only copy
the BMH and Machine CRs to the spoke cluster
when the Agent has started installing.
CrystalChun added a commit to CrystalChun/assisted-service that referenced this pull request Jun 7, 2023
https://issues.redhat.com//browse/MGMT-14871
Backport to ACM 2.7
Cherry pick of
openshift#5250

Original description:
OCPBUGS-7076
Previously the BMAC would copy the BMH and
Machine CRs of a Day2 worker to the spoke cluster before
the Agent began installing. If the Agent doesn't
start installing within the two hours these CRs
were copied over, the CSRs for these nodes will
not be approved by the machine approver pod.

To prevent this from happening, only copy
the BMH and Machine CRs to the spoke cluster
when the Agent has started installing.
CrystalChun added a commit to CrystalChun/assisted-service that referenced this pull request Jun 7, 2023
https://issues.redhat.com//browse/MGMT-14871
Backport to ACM 2.7
Cherry pick of
openshift#5250

OCPBUGS-7076: Copy Day2 BMH if Agent is installing (openshift#5250)

https://issues.redhat.com/browse/OCPBUGS-7076
Previously the BMAC would copy the BMH and Machine
CRs of a Day2 worker to the spoke cluster before
the Agent began installing. If the Agent doesn't
start installing within the two hours these CRs
were copied over, the CSRs for these nodes will
not be approved by the machine approver pod.

To prevent this from happening, only copy
the BMH and Machine CRs to the spoke cluster
when the Agent has started installing.
@openshift-merge-robot
Copy link

Fix included in accepted release 4.14.0-0.nightly-2023-09-11-201102

@openshift-merge-robot
Copy link

Fix included in accepted release 4.14.0-0.nightly-2023-09-12-024050

@openshift-merge-robot
Copy link

Fix included in accepted release 4.14.0-0.nightly-2023-09-15-101929

danielerez pushed a commit to danielerez/assisted-service that referenced this pull request Oct 15, 2023
https://issues.redhat.com/browse/OCPBUGS-7076
Previously the BMAC would copy the BMH and Machine
CRs of a Day2 worker to the spoke cluster before
the Agent began installing. If the Agent doesn't
start installing within the two hours these CRs
were copied over, the CSRs for these nodes will
not be approved by the machine approver pod.

To prevent this from happening, only copy
the BMH and Machine CRs to the spoke cluster
when the Agent has started installing.
@CrystalChun CrystalChun deleted the OCPBUGS-7076 branch January 29, 2024 23:45
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. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants