-
Notifications
You must be signed in to change notification settings - Fork 81
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
Availability set deprecation #1025
base: master
Are you sure you want to change the base?
Conversation
/test |
Testrun: e2e-xn69g +---------------------+---------------------------+-----------+----------+ | NAME | STEP | PHASE | DURATION | +---------------------+---------------------------+-----------+----------+ | infrastructure-test | infra-flow-test | Succeeded | 21m14s | | infrastructure-test | infra-flow-migration-test | Succeeded | 26m21s | | bastion-test | bastion-test | Succeeded | 9m4s | | infrastructure-test | infrastructure-test | Succeeded | 23m8s | +---------------------+---------------------------+-----------+----------+ |
if err := fctx.client.Get(ctx, k8sclient.ObjectKey{ | ||
Namespace: fctx.infra.Namespace, | ||
Name: azure.CloudControllerManagerName, | ||
}, deployment); k8sclient.IgnoreNotFound(err) != nil { | ||
return err | ||
} else if k8sclient.IgnoreNotFound(err) != nil { | ||
return nil | ||
} |
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.
if err := fctx.client.Get(ctx, k8sclient.ObjectKey{ | |
Namespace: fctx.infra.Namespace, | |
Name: azure.CloudControllerManagerName, | |
}, deployment); k8sclient.IgnoreNotFound(err) != nil { | |
return err | |
} else if k8sclient.IgnoreNotFound(err) != nil { | |
return nil | |
} | |
if err := fctx.client.Get(ctx, k8sclient.ObjectKey{ | |
Namespace: fctx.infra.Namespace, | |
Name: azure.CloudControllerManagerName, | |
}, deployment); k8sclient.IgnoreNotFound(err) != nil { | |
return err | |
} |
Not sure if this is the right one to keep
@@ -28,6 +29,14 @@ const ( | |||
defaultLongTimeout = 4 * time.Minute | |||
) | |||
|
|||
var setSeparator = sync.OnceFunc(func() { | |||
shared.Separator = "|" |
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'm confused, Why do you change the separator here?
Also, is setSeparator the set separator or does it set the separator?
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.
The setSeparator
is supposed to change the separator used in the state once. The separator is changed from "/" to "|" because some of the strings that we save do use "/" internally and when the state is restored the slashes interfere with really restoring the state.
We can refactor the strings that we save, or escape the strings or just change the separator. Previous to this PR (and I believe after removing much of the code post-deprecation) we didn't really need to restore things from the state which is why this is only introduced now.
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.
Also, is setSeparator the set separator or does it set the separator?
Is the function to set the separator once. It is executed on package import with the init
couple lines below.
func (c *LoadBalancersClient) Get(ctx context.Context, resourceGroupName, name string) (*armnetwork.LoadBalancer, error) { | ||
res, err := c.client.Get(ctx, resourceGroupName, name, nil) | ||
if err != nil { | ||
return nil, FilterNotFoundError(err) |
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.
Haven't checked around, but is this how we usually do it? This get method will always shadow notFound, I think this should be done when calling this function (if the caller wants it)
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.
This is also how the other client implementations work. The comment is fair, but for local consistency it would be applied in a separate PR.
dbc9ae3
to
ba7a8a1
Compare
@@ -171,7 +177,16 @@ func (fctx *FlowContext) EnsureAvailabilitySet(ctx context.Context) error { | |||
return nil | |||
} | |||
|
|||
avset, err := fctx.ensureAvailabilitySet(ctx, log, *avsetCfg) | |||
// complete AS migration. | |||
if v := fctx.whiteboard.GetChild("migration").GetChild(KindAvailabilitySet.String()).Get("complete"); v != nil && *v == "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.
Nit: I think it would be nice we define such keys as "migration" and "complete" somewhere as constants.
// return early if the migration has already been complete | ||
if v := fctx.whiteboard.GetChild("migration").GetChild(KindAvailabilitySet.String()).Get("complete"); v != nil && *v == "true" { | ||
return nil | ||
} | ||
// return early if the cluster does not have AS. | ||
if fctx.whiteboard.GetChild(ChildKeyIDs).Get(KindAvailabilitySet.String()) == nil { | ||
return nil | ||
} | ||
|
||
// IF VMOs are not needed, or the migration is already done, return early. | ||
if !helper.HasShootVmoMigrationAnnotation(fctx.cluster.Shoot.GetAnnotations()) { | ||
return nil | ||
} |
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.
Nit: Aren't these all dependencies for the migration task - maybe we could put them into a separate function and use this function as task dependency.
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.
These checks as a group are used in one place. The separate function will just be giving a name to preflight checks but I can oblige
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.
Rethinking your question:
-
Do you mean as a
shared.DoIf
?
It's a question of when are the dependencies of a task evaluated (at build or at runtime) and AFAIK they are on build time. At that point you may not have theKindAvailabilitySet
in the state for example. -
Do you mean as a
shared.Dependency
?
I am actually not sure if this will block a child Task in the graph from being executed. I would need to test the scemantics. It may either mark the skipped parent as completed (so the childen are always executed), or it may really prune the tree (what you suggested I believe). But I need to check first.
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.
Based on https://github.com/gardener/gardener/blob/84184385dbb9616c2c838e4f24487cae2be75da0/pkg/utils/flow/flow.go#L303 I think it marks the skipped nodes as completed
} | ||
|
||
// IsVmoRequiredForInfrastructure determines if VMO is required. | ||
func (ia *InfrastructureAdapter) IsVmoRequiredForInfrastructure() bool { |
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 don't see where this function is used?
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.
old artifact - thank you
if lb.Properties == nil || len(lb.Properties.FrontendIPConfigurations) == 0 { | ||
return nil | ||
} |
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.
duplicated check
How to categorize this PR?
/area control-plane
/kind enhancement
/platform azure
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: