-
Notifications
You must be signed in to change notification settings - Fork 295
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
✨ Add NetworkConfigurations to VSphereFailureDomain #3049
Conversation
Welcome @Nutrymaco! |
Hi @Nutrymaco. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test Do I get it right that the use cases are:
|
Yes |
Question: does it make sense to have the full network definition, or is it enought only have the one originally introduced (and not used) here:
|
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.
Sorry for questioning this now and not earlier. But because this is changing APIs we should be careful to only add/change when we think its a long-term commitment because we have to maintain and support it then for a long time.
Question: what is the reasoning behind wanting to overwrite the template of a machine? Why can't it stay the same?
A substantial part of a MachineDeployment is being able to have the same machine multiple times. Could you please explain the actual use-case where this comes from?
Maybe it helps to split up this discussion from the networking part and maybe also handle them as separate Issues/Pull Requests.
Yes, let's discuss it in different issue. I'll remove template related changes. |
We at least need |
@chrischdi @killianmuldoon |
cc @lubronzhan , @neolit123 , this is a change to the govmomi API types :-) Can you maybe take a look if you think they make sense on a high level 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.
thanks, for the PR.
added a few comments.
continue | ||
} | ||
if _, err := deploymentZoneCtx.AuthSession.Finder.Network(ctx, networkConfig.NetworkName); err != nil { | ||
conditions.MarkFalse(deploymentZoneCtx.VSphereDeploymentZone, infrav1.VSphereFailureDomainValidatedCondition, infrav1.NetworkNotFoundReason, clusterv1.ConditionSeverityError, "network %s is misconfigured", networkConfig.NetworkName) |
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.
is the network not found rather than misconfigured in such a scenario?
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 like it's copied from the original network config without failure domain. Could you update both places?
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.
Updated both
pkg/services/vimmachine.go
Outdated
device.NetworkName = network | ||
} | ||
|
||
func mergeFailureDomainNetSpecToNetworkDeviceSpec(device *infrav1.NetworkDeviceSpec, fd infrav1.NetworkConfiguration) { |
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.
func mergeFailureDomainNetSpecToNetworkDeviceSpec(device *infrav1.NetworkDeviceSpec, fd infrav1.NetworkConfiguration) { | |
func mergeNetworkConfigurationInNetworkDeviceSpec(device *infrav1.NetworkDeviceSpec, fd infrav1.NetworkConfiguration) { |
more of a question whether having the types in the function makes more sense?
and on that note should fd
be replaced with something like nc
?
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.
Fixed names as suggested. If you mean types in function name, i don't see other choice due to lack of overloading in go.
Should the Network be marked as deprecated in favor of the new In general LGTM |
apis/v1alpha3/topology_conversion.go
Outdated
if len(in.NetworkConfigurations) > 0 { | ||
networks := make([]string, len(in.NetworkConfigurations)) | ||
for i := range in.NetworkConfigurations { | ||
networks[i] = in.NetworkConfigurations[i].NetworkName | ||
} | ||
out.Networks = networks | ||
} | ||
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.
I think we should not convert it from a different struct in v1alpha3 to v1beta1 (same for v1alpha4), because it would cause different results when forward and backwards converting.
We should use it as new additional field because we already have the networks element also in v1beta1.
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.
Replaced with the generated conversion
Sorry for the late reply, overall lgtm |
Hi, @chrischdi ! |
That should be the final steps :-) |
@chrischdi |
@Nutrymaco just a few smaller findings from my side |
I'll take another look once tests and linter are back to green |
edd72e8
to
50ad18e
Compare
50ad18e
to
4b8978c
Compare
/test pull-cluster-api-provider-vsphere-e2e-vcsim-govmomi-main |
Thank you very much! /lgtm Will merge once all e2e tests are completed & green |
LGTM label has been added. Git tree hash: 8f254d42426a20bf548cb025fdf428fc517ca8c8
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
What this PR does / why we need it:
This PR adds additional API to Failure Domain. This allows to have different configurations based on the selected region/zone.
(Edited by chrischdi)
User stories:
(end of Edit by chrischdi)
Which issue(s) this PR fixes
Partially it repeats work that was done for issue #1964 in #1967. But also allows overriding VM template.