-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fix reconciliation of user managed public IPs in flow #1052
Conversation
// TODO(hebelsan) remove in later release because we add the key when creating the object. | ||
if _, ok := target.Tags[ManagedByGardenerTag]; !ok { | ||
target.Tags[ManagedByGardenerTag] = to.Ptr("true") | ||
} | ||
|
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.
I'd prefer a merge of target.Tags
into base.Tags
in l.541.
Tested migration from terraform to flow with customer managed public IP and shoot prefix name. |
@hebelsan You need rebase this pull request with latest master branch. Please check. |
Successfully tested that the public IP stays the same after switching to this controller version. |
/test |
Testrun: e2e-qlb6r +---------------------+---------------------------+-----------+----------+ | NAME | STEP | PHASE | DURATION | +---------------------+---------------------------+-----------+----------+ | infrastructure-test | infrastructure-test | Succeeded | 27m38s | | infrastructure-test | infra-flow-test | Succeeded | 25m49s | | infrastructure-test | infra-flow-migration-test | Succeeded | 29m20s | | bastion-test | bastion-test | Succeeded | 13m35s | +---------------------+---------------------------+-----------+----------+ |
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.
just a few formatting notes
(address.Tags[azure.CCMServiceTagKey] == nil && address.Tags[azure.CCMLegacyServiceTagKey] == nil) | ||
ptr.Deref(address.Tags[TagManagedByGardener], "") == "true" && | ||
ptr.Deref(address.Tags[TagShootName], "") == fctx.adapter.TechnicalName() | ||
|
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.
@@ -424,6 +427,13 @@ func (fctx *FlowContext) ensurePublicIps(ctx context.Context) error { | |||
// delete all the resources that are not in the list of target resources | |||
pipCfg, ok := desiredConfiguration[name] | |||
if !ok { | |||
// skip deletion of IPs that may fit our criteria, but are referenced explicitly in the shoot spec. |
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.
// skip deletion of IPs that may fit our criteria, but are referenced explicitly in the shoot spec. | |
// skip deletion of IPs that may fit our criteria, but are referenced explicitly in the shoot spec. |
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.
Should be fixed with latest commit. PTAL :)
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.
/lgtm
@@ -21,4 +21,7 @@ const ( | |||
ChildKeyMigration = "migration" | |||
// ChildKeyComplete is a key to indicate whether a task is complete. | |||
ChildKeyComplete = "complete" | |||
|
|||
// ManagedByGardenerTag is the tag used to mark resources managed by Gardener. | |||
ManagedByGardenerTag = "managedByGardener" |
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.
Following CCM standards we could use kebab-case instead.
@@ -424,6 +427,13 @@ func (fctx *FlowContext) ensurePublicIps(ctx context.Context) error { | |||
// delete all the resources that are not in the list of target resources | |||
pipCfg, ok := desiredConfiguration[name] | |||
if !ok { | |||
// skip deletion of IPs that may fit our criteria, but are referenced explicitly in the shoot spec. |
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.
Should be fixed with latest commit. PTAL :)
How to categorize this PR?
/area quality
/kind bug
/platform azure
What this PR does / why we need it:
This PR prevents the deletion of certain user managed public IPs during flow reconciliation after Terraform migration.
It adds a tag to IPs that reside in the shoot namespace and have the shoot prefix but should not be touched by us.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: