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

[WIP] MHC created CR isn't deleted by the remediator #347

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mshitrit
Copy link
Member

@mshitrit mshitrit commented Sep 9, 2024

Why we need this PR

When a CR is created by MHC it's not deleted by the remediator (SNR) in case the remediator supports multiple templates.
The reason is that when MHC creates the CR it creates a generated name for the CR which does not match the machine name.
When the same apply for node base remediation the additional (node name and template name) info is stored in annotations on the CR, but for machine based remediation the remediator doesn't access those annotations.

Changes made

  • When creating an MHC remediation CR using the machine name and not generated name.
  • Multiple support annotation "NodeName" will now hold the correct node name (instead of the machine name) or empty value in case there is an issue getting the node name.

Which issue(s) this PR fixes

ECOPROJECT-2077

Test plan

Added a regression test

Copy link
Contributor

openshift-ci bot commented Sep 9, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the approved label Sep 9, 2024
@mshitrit mshitrit changed the title MHC created CR isn't deleted by the remediator [WIP] MHC created CR isn't deleted by the remediator Sep 9, 2024
@mshitrit
Copy link
Member Author

mshitrit commented Sep 9, 2024

/test ?

Copy link
Contributor

openshift-ci bot commented Sep 9, 2024

@mshitrit: The following commands are available to trigger required jobs:

  • /test 4.12-ci-bundle-my-bundle
  • /test 4.12-images
  • /test 4.12-openshift-e2e
  • /test 4.12-test
  • /test 4.13-ci-bundle-my-bundle
  • /test 4.13-images
  • /test 4.13-openshift-e2e
  • /test 4.13-test
  • /test 4.14-ci-bundle-my-bundle
  • /test 4.14-images
  • /test 4.14-openshift-e2e
  • /test 4.14-test
  • /test 4.15-ci-bundle-my-bundle
  • /test 4.15-images
  • /test 4.15-openshift-e2e
  • /test 4.15-test
  • /test 4.16-ci-bundle-my-bundle
  • /test 4.16-images
  • /test 4.16-openshift-e2e
  • /test 4.16-test
  • /test 4.17-ci-bundle-my-bundle
  • /test 4.17-images
  • /test 4.17-openshift-e2e
  • /test 4.17-test

Use /test all to run all jobs.

In response to this:

/test ?

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.

@mshitrit
Copy link
Member Author

mshitrit commented Sep 9, 2024

/test 4.16-openshift-e2e

controllers/machinehealthcheck_controller_test.go Outdated Show resolved Hide resolved
controllers/resources/manager.go Outdated Show resolved Hide resolved
controllers/resources/manager.go Outdated Show resolved Hide resolved
1. CR is created with regular (non generated) machine name when using a multiple support template
2. Multiple template Annotation placed on the CR contains the correct node/template name

Signed-off-by: Michael Shitrit <[email protected]>
This severs two purpuses:
- It will be set on NodeName annotation instead of previouslly set machine Name for MHC use case.
- Indication that for MHC remediation, in which case the normal (non generated) Machine name is set as the CR name

Signed-off-by: Michael Shitrit <[email protected]>
@mshitrit
Copy link
Member Author

/test 4.16-openshift-e2e

…t machine name when checking NodeName annotation.

Signed-off-by: Michael Shitrit <[email protected]>
@mshitrit
Copy link
Member Author

/test 4.16-openshift-e2e

controllers/machinehealthcheck_controller.go Show resolved Hide resolved
controllers/machinehealthcheck_controller.go Outdated Show resolved Hide resolved
controllers/resources/manager.go Show resolved Hide resolved
e2e/mhc_e2e_test.go Show resolved Hide resolved
@mshitrit
Copy link
Member Author

/test 4.16-openshift-e2e

@openshift-ci openshift-ci bot added the lgtm label Sep 11, 2024
Copy link
Contributor

openshift-ci bot commented Sep 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mshitrit, slintes

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 removed the lgtm label Sep 11, 2024
Copy link
Contributor

openshift-ci bot commented Sep 11, 2024

New changes are detected. LGTM label has been removed.

@mshitrit
Copy link
Member Author

/test 4.16-openshift-e2e

Copy link
Contributor

openshift-ci bot commented Nov 15, 2024

@mshitrit: 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/4.16-openshift-e2e e51cac5 link true /test 4.16-openshift-e2e
ci/prow/4.18-openshift-e2e e51cac5 link true /test 4.18-openshift-e2e

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants