This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 192
TKR webhook should not reject a paused cluster. #3724
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@imikushin @randomvariable any thoughts on this proposed fix? |
Codecov Report
@@ Coverage Diff @@
## main #3724 +/- ##
==========================================
- Coverage 46.22% 45.32% -0.91%
==========================================
Files 400 425 +25
Lines 39620 41176 +1556
==========================================
+ Hits 18316 18661 +345
- Misses 19617 20807 +1190
- Partials 1687 1708 +21
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
imikushin
approved these changes
Oct 21, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks @HanFa
HanFa
commented
Oct 25, 2022
@@ -65,6 +65,10 @@ func (cw *Webhook) Handle(ctx context.Context, req admission.Request) admission. | |||
} | |||
|
|||
func (cw *Webhook) getClusterClass(ctx context.Context, cluster *clusterv1.Cluster) (*clusterv1.ClusterClass, *admission.Response) { | |||
if cluster.Spec.Paused { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested by @imikushin
During management cluster deletion, the CLI should
- replicate CM that has label
run.tanzu.vmware.com/additional-compatible-tkrs: ""
(not needed) - replicate a single TKR (specified by the cluster object label) and referenced OSimages from MC to the cleanup cluster.
- transplant ClusterClass and Cluster (this will be handled by the CAPI)
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
A fix cherrypicked from #3557
Generally, the webhook should always admit a Cluster resource that is paused.
Oracle MC deletion is blocked without this change
When deleting a management cluster, the CAPI Cluster resource will be first paused an moved to the bootstrap kind cluster. During this process, we can not guarantee that the cluster's metadata is resolve-able, because its corresponding TKR might not be there yet.
In fact, the webhook is rejecting the Cluster CR when deleting the MC, if that MC created was using
--additional-manifests <some-tkr-url>
. This TKR from manifests won't be presented in the Bootstrap Kind cluster during deletion.Which issue(s) this PR fixes
Fixes #
Describe testing done for PR
Webhook unit test
Release note
Additional information
Special notes for your reviewer