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

⚠️ Remove Metal3Machine owner reference from BMH #1742

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

kashifest
Copy link
Member

@kashifest kashifest commented May 24, 2024

Metal3Machine should not own BMH. It should consume it and release it when not needed. we already put a M3M consumer reference on BMH. This also would mean that for pivoting use cases we must add the clusterctl move labels in the CRDs. Otherwise BMH wont be pivoted to target clusters.

⚠️ Now, BMH object/CRD needs to have The object has the clusterctl.cluster.x-k8s.io/move label or the clusterctl.cluster.x-k8s.io/move-hierarchy label to make sure BMH is pivoted to target cluster and removed from the source. clusterctl.cluster.x-k8s.io/move and clusterctl.cluster.x-k8s.io/move-hierarchy labels could be applied to single objects or at the CRD level (the label applies to all the objects).

We still keep the removal of owner reference code for one minor release cycle to facilitate upgrade scenario where a BMH could still have an owner reference set from previous version. Starting from v1.11.x minor cycle we will remove this code also.

@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 24, 2024
@kashifest
Copy link
Member Author

/hold
This is a WIP

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 24, 2024
@kashifest kashifest changed the title 🌱 Remove Metal3Machine owner reference from BMH WIP: 🌱 Remove Metal3Machine owner reference from BMH May 24, 2024
@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 24, 2024
@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-integration-test-main

1 similar comment
@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-integration-test-main

@kashifest
Copy link
Member Author

/test ?

@metal3-io-bot
Copy link
Contributor

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

  • /test build
  • /test generate
  • /test gomod
  • /test manifestlint
  • /test markdownlint
  • /test metal3-centos-e2e-integration-test-main
  • /test metal3-ubuntu-e2e-integration-test-main
  • /test shellcheck
  • /test test
  • /test unit

The following commands are available to trigger optional jobs:

  • /test metal3-centos-e2e-basic-test-main
  • /test metal3-centos-e2e-feature-test-main
  • /test metal3-e2e-1-26-1-27-upgrade-test-main
  • /test metal3-e2e-1-27-1-28-upgrade-test-main
  • /test metal3-e2e-1-28-1-29-upgrade-test-main
  • /test metal3-e2e-clusterctl-upgrade-test-main
  • /test metal3-ubuntu-e2e-basic-test-main
  • /test metal3-ubuntu-e2e-feature-test-main

Use /test all to run the following jobs that were automatically triggered:

  • generate
  • gomod
  • manifestlint
  • unit

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/test-infra repository.

@shibaPuppy
Copy link
Contributor

@kashifest
It seems to be PR for the same purpose.
can I close my PR?

@kashifest
Copy link
Member Author

@kashifest It seems to be PR for the same purpose. can I close my PR?

Yes, I am doing the same thing here, I didn't notice you had the same thing in another PR, didnt mean to over step. I am currently testing this since it seems to not passing the pivot scenario so it would need more changes. I am also ok to close my one if you have progressed more.

@shibaPuppy
Copy link
Contributor

@kashifest
i can't spend much time working, so I don't come often.
i will close my PR. :)

@Rozzii Rozzii added this to the 1.8.0 milestone Jun 28, 2024
@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-integration-test-main

1 similar comment
@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-integration-test-main

@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-integration-test-main

1 similar comment
@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-integration-test-main

@kashifest
Copy link
Member Author

/test metal3-centos-e2e-integration-test-main

@kashifest
Copy link
Member Author

/test ?

@metal3-io-bot
Copy link
Contributor

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

  • /test build
  • /test generate
  • /test gomod
  • /test manifestlint
  • /test markdownlint
  • /test metal3-centos-e2e-integration-test-main
  • /test metal3-ubuntu-e2e-integration-test-main
  • /test shellcheck
  • /test test
  • /test unit

The following commands are available to trigger optional jobs:

  • /test metal3-centos-e2e-basic-test-main
  • /test metal3-centos-e2e-feature-test-main-features
  • /test metal3-centos-e2e-feature-test-main-pivoting
  • /test metal3-centos-e2e-feature-test-main-remediation
  • /test metal3-e2e-1-29-1-30-upgrade-test-main
  • /test metal3-e2e-clusterctl-upgrade-test-main
  • /test metal3-ubuntu-e2e-basic-test-main
  • /test metal3-ubuntu-e2e-feature-test-main-features
  • /test metal3-ubuntu-e2e-feature-test-main-pivoting
  • /test metal3-ubuntu-e2e-feature-test-main-remediation

Use /test all to run the following jobs that were automatically triggered:

  • build
  • generate
  • gomod
  • manifestlint
  • unit

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.

@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-feature-test-main-features

@kashifest
Copy link
Member Author

/test metal3-e2e-clusterctl-upgrade-test-main

@kashifest kashifest changed the title WIP: 🌱 Remove Metal3Machine owner reference from BMH 🌱 Remove Metal3Machine owner reference from BMH Nov 26, 2024
@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-feature-test-main-pivoting

1 similar comment
@kashifest
Copy link
Member Author

/test metal3-ubuntu-e2e-feature-test-main-pivoting

@kashifest
Copy link
Member Author

/test metal3-centos-e2e-feature-test-main-pivoting

2 similar comments
@kashifest
Copy link
Member Author

/test metal3-centos-e2e-feature-test-main-pivoting

@kashifest
Copy link
Member Author

/test metal3-centos-e2e-feature-test-main-pivoting

@kashifest
Copy link
Member Author

/hold
For discussion

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 27, 2024
Copy link
Member

@lentzi90 lentzi90 left a comment

Choose a reason for hiding this comment

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

Thank you for doing this!
How should we handle upgrades? From what I can see, we would not automatically remove owner references that are already there, so it would be up to the user to remove them after upgrade I guess.
One alternative we could consider is to keep the code that removes the owner reference when deleting the M3M for one minor release cycle. Then we can say that users must do a rollout in order to get rid of the owner references, or they can do it manually if they prefer. What do you think?

@kashifest
Copy link
Member Author

Thank you for doing this! How should we handle upgrades? From what I can see, we would not automatically remove owner references that are already there, so it would be up to the user to remove them after upgrade I guess. One alternative we could consider is to keep the code that removes the owner reference when deleting the M3M for one minor release cycle. Then we can say that users must do a rollout in order to get rid of the owner references, or they can do it manually if they prefer. What do you think?

Yes we can do that. I thought of writing a doc update and ask users to remove it manually. We can also keep the removal code for one minor cycle and ask for rollout.

@tuminoid
Copy link
Member

This will not make CAPM3 1.9, will it? @kashifest

@tuminoid tuminoid modified the milestones: CAPM3 - v1.9, CAPM3 - v1.10 Dec 17, 2024
@tuminoid
Copy link
Member

This will not make CAPM3 1.9, will it? @kashifest

Discussed offline, this is only going to have a heads-up in 1.9, actual fixes will go to 1.10. Changed milestone accordingly.

@tuminoid
Copy link
Member

@kashifest can we finalize this and merge? Any breaking changes would be good to get merged early in minor cycle.

@kashifest
Copy link
Member Author

@kashifest can we finalize this and merge? Any breaking changes would be good to get merged early in minor cycle.

Yes good point, I will recheck the PR and update it

Metal3Machine should not own BMH. It should consume it and release it when not needed. we already put a M3M consumer reference on BMH. This also would mean that for pivoting use cases we must add the clusterctl move labels in the CRDs. Otherwise BMH wont be pivoted to target clusters.

⚠️ Now, BMH object/CRD needs to have The object has the clusterctl.cluster.x-k8s.io/move label or the clusterctl.cluster.x-k8s.io/move-hierarchy  label to make sure BMH is pivoted to target cluster and removed from the source. clusterctl.cluster.x-k8s.io/move and clusterctl.cluster.x-k8s.io/move-hierarchy labels could be applied to single objects or at the CRD level (the label applies to all the objects).

We still keep the removal of owner reference code for one minor release cycle to facilitate upgrade scenario where a BMH could still have an owner reference set from previous version. Starting from v1.11.x minor cycle we will remove this code also.
Signed-off-by: Kashif Khan <[email protected]>
@kashifest kashifest force-pushed the remove/bmh-ownerRef branch from 6c7d0c1 to 715a0d0 Compare January 13, 2025 08:10
@kashifest
Copy link
Member Author

/test metal3-centos-e2e-feature-test-main-pivoting
/test metal3-ubuntu-e2e-integration-test-main
/test metal3-centos-e2e-integration-test-main

@kashifest
Copy link
Member Author

/hold cancel
This is good to go in now @lentzi90 @tuminoid. I will push another PR and put it on hold for v1.11 minor release cycle where we get rid of removal of owner reference code also.

Yes good point, I will recheck the PR and update it

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 13, 2025
@kashifest
Copy link
Member Author

A followup to be landed in v1.11 release cycle is also created #2238

@tuminoid
Copy link
Member

/retest

Copy link
Member

@lentzi90 lentzi90 left a comment

Choose a reason for hiding this comment

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

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lentzi90

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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 13, 2025
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2025
@metal3-io-bot metal3-io-bot merged commit bd0d602 into metal3-io:main Jan 13, 2025
20 checks passed
@metal3-io-bot metal3-io-bot deleted the remove/bmh-ownerRef branch January 13, 2025 11:51
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Status: CAPM3 WIP
Development

Successfully merging this pull request may close these issues.

7 participants