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

MGMT-15559: Change detached annotation condition in non-converged flow #5445

Merged
merged 1 commit into from Sep 19, 2023

Conversation

CrystalChun
Copy link
Contributor

@CrystalChun CrystalChun commented Aug 25, 2023

MGMT-15559
Day 2 workers create BMH and Machine CRs on the spoke cluster when the host starts installing. The non-converged flow initially added the detached annotation for the BMH when the host starts installing too. This causes the BMH to stop being reconciled so the BMH and Machine CRs aren't created in the spoke cluster.

This change adds the detached annotation when the host reaches rebooting, joined, or failed instead of installing so that it doesn't conflict with adding the BMH/Machine to the spoke cluster.

List all the issues related to this PR

MGMT-15639

  • 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 @ori-amizur

@openshift-ci openshift-ci bot requested a review from ori-amizur August 25, 2023 20:51
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 25, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 25, 2023

@CrystalChun: This pull request references MGMT-15639 which is a valid jira issue.

In response to this:

MGMT-15639
Day 2 workers create BMH and Machine CRs on the spoke cluster when the host starts installing. The non-converged flow initially added the detached annotation for the BMH when the host starts installing too. This causes the BMH to stop being reconciled so the BMH and Machine CRs aren't created in the spoke cluster.

This change adds the detached annotation when the host reaches rebooting, joined, or failed instead of installing so that it doesn't conflict with adding the BMH/Machine to the spoke cluster.

List all the issues related to this PR

MGMT-15639

  • 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 @ori-amizur

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 added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 25, 2023
@openshift-ci
Copy link

openshift-ci bot commented Aug 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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:

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 Aug 25, 2023
@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Merging #5445 (180f859) into master (7e71500) will increase coverage by 0.65%.
Report is 10 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5445      +/-   ##
==========================================
+ Coverage   67.65%   68.30%   +0.65%     
==========================================
  Files         232      232              
  Lines       33988    35081    +1093     
==========================================
+ Hits        22994    23963     +969     
- Misses       8948     9036      +88     
- Partials     2046     2082      +36     
Files Changed Coverage Δ
...nal/controller/controllers/bmh_agent_controller.go 74.91% <100.00%> (+0.14%) ⬆️

... and 7 files with indirect coverage changes

Copy link
Contributor

@ori-amizur ori-amizur left a comment

Choose a reason for hiding this comment

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

Is it possible to add tests to verify that the problem is fixed?

@@ -553,27 +554,6 @@ func (r *BMACReconciler) ensureBMHDetached(log logrus.FieldLogger, bmh *bmh_v1al
return reconcileComplete{dirty: true, stop: true}
}

// The detached annotation is added if the installation of the agent associated with
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I think it is better to keep they were before this fix and just rename and change the function addBMHDetachedAnnotationIfAgentHasStartedInstallation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok sounds good! I reverted it back but I'm not sure what the name of the function should be 😅 any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

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

addBMHDetachedAnnotationIfHostIsRebooting ?

@CrystalChun
Copy link
Contributor Author

Is it possible to add tests to verify that the problem is fixed?

Yes! Probably an e2e test that ensures that the day2 workers are installed and their BMHs exist in the release repo https://github.com/openshift/release/blob/master/ci-operator/step-registry/assisted/baremetal/operator/ztp/assisted-baremetal-operator-ztp-workflow.yaml#L9
Wdyt?

@CrystalChun
Copy link
Contributor Author

CrystalChun commented Sep 6, 2023

/retitle MGMT-15559: Change detached annotation condition in non-converged flow

@openshift-ci openshift-ci bot changed the title MGMT-15639: Change detached annotation condition in non-converged flow MGMT-15559: Change detached annotation condition in non-converged flow Sep 6, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 6, 2023

@CrystalChun: This pull request references MGMT-15559 which is a valid jira issue.

In response to this:

MGMT-15639
Day 2 workers create BMH and Machine CRs on the spoke cluster when the host starts installing. The non-converged flow initially added the detached annotation for the BMH when the host starts installing too. This causes the BMH to stop being reconciled so the BMH and Machine CRs aren't created in the spoke cluster.

This change adds the detached annotation when the host reaches rebooting, joined, or failed instead of installing so that it doesn't conflict with adding the BMH/Machine to the spoke cluster.

List all the issues related to this PR

MGMT-15639

  • 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 @ori-amizur

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

openshift-ci-robot commented Sep 6, 2023

@CrystalChun: This pull request references MGMT-15559 which is a valid jira issue.

In response to this:

MGMT-15559
Day 2 workers create BMH and Machine CRs on the spoke cluster when the host starts installing. The non-converged flow initially added the detached annotation for the BMH when the host starts installing too. This causes the BMH to stop being reconciled so the BMH and Machine CRs aren't created in the spoke cluster.

This change adds the detached annotation when the host reaches rebooting, joined, or failed instead of installing so that it doesn't conflict with adding the BMH/Machine to the spoke cluster.

List all the issues related to this PR

MGMT-15639

  • 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 @ori-amizur

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

/cc @filanov

@openshift-ci openshift-ci bot requested a review from filanov September 6, 2023 14:27
@CrystalChun
Copy link
Contributor Author

/retest-required

https://issues.redhat.com/browse/MGMT-15559
Day 2 workers create BMH and Machine CRs on the spoke cluster
when the host starts installing. The non-converged flow
initially added the detached annotation for the BMH when the
host starts installing too. This causes the BMH to stop being
reconciled so the BMH and Machine CRs aren't created in the
spoke cluster.

This change adds the detached annotation when the host reaches
rebooting, joined, or failed instead of installing so that it
doesn't conflict with adding the BMH/Machine to the spoke cluster.
@CrystalChun
Copy link
Contributor Author

/retest

@ori-amizur
Copy link
Contributor

/lgtm

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

openshift-ci bot commented Sep 19, 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 cabc63d into openshift:master Sep 19, 2023
15 checks passed
@CrystalChun
Copy link
Contributor Author

/cherry-pick release-ocm-2.9

@openshift-cherrypick-robot

@CrystalChun: new pull request created: #5502

In response to this:

/cherry-pick release-ocm-2.9

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

@CrystalChun
Copy link
Contributor Author

/cherry-pick release-ocm-2.7

@openshift-cherrypick-robot

@CrystalChun: cannot fork openshift/assisted-service: could not fetch all existing repos: Get "http://ghproxy/user/33322735/repos?per_page=100&page=5": dial tcp 172.30.229.2:80: i/o timeout

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

/cherry-pick release-ocm-2.8

@openshift-cherrypick-robot

@CrystalChun: new pull request created: #5503

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

/cherry-pick release-ocm-2.7

@openshift-cherrypick-robot

@CrystalChun: #5445 failed to apply on top of branch "release-ocm-2.7":

Applying: MGMT-15559: Change detached annotation condition in non-converged flow
Using index info to reconstruct a base tree...
M	internal/controller/controllers/bmh_agent_controller.go
M	internal/controller/controllers/bmh_agent_controller_test.go
Falling back to patching base and 3-way merge...
Auto-merging internal/controller/controllers/bmh_agent_controller_test.go
CONFLICT (content): Merge conflict in internal/controller/controllers/bmh_agent_controller_test.go
Auto-merging internal/controller/controllers/bmh_agent_controller.go
CONFLICT (content): Merge conflict in internal/controller/controllers/bmh_agent_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 MGMT-15559: Change detached annotation condition in non-converged flow
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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 added a commit to CrystalChun/assisted-service that referenced this pull request Sep 21, 2023
openshift#5445)

https://issues.redhat.com/browse/MGMT-15559
Day 2 workers create BMH and Machine CRs on the spoke cluster
when the host starts installing. The non-converged flow
initially added the detached annotation for the BMH when the
host starts installing too. This causes the BMH to stop being
reconciled so the BMH and Machine CRs aren't created in the
spoke cluster.

This change adds the detached annotation when the host reaches
rebooting, joined, or failed instead of installing so that it
doesn't conflict with adding the BMH/Machine to the spoke cluster.
openshift-merge-robot pushed a commit that referenced this pull request Sep 27, 2023
#5445) (#5507)

https://issues.redhat.com/browse/MGMT-15559
Day 2 workers create BMH and Machine CRs on the spoke cluster
when the host starts installing. The non-converged flow
initially added the detached annotation for the BMH when the
host starts installing too. This causes the BMH to stop being
reconciled so the BMH and Machine CRs aren't created in the
spoke cluster.

This change adds the detached annotation when the host reaches
rebooting, joined, or failed instead of installing so that it
doesn't conflict with adding the BMH/Machine to the spoke cluster.
danielerez pushed a commit to danielerez/assisted-service that referenced this pull request Oct 15, 2023
openshift#5445)

https://issues.redhat.com/browse/MGMT-15559
Day 2 workers create BMH and Machine CRs on the spoke cluster
when the host starts installing. The non-converged flow
initially added the detached annotation for the BMH when the
host starts installing too. This causes the BMH to stop being
reconciled so the BMH and Machine CRs aren't created in the
spoke cluster.

This change adds the detached annotation when the host reaches
rebooting, joined, or failed instead of installing so that it
doesn't conflict with adding the BMH/Machine to the spoke cluster.
@CrystalChun CrystalChun deleted the MGMT-15639 branch January 29, 2024 23:46
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-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