-
Notifications
You must be signed in to change notification settings - Fork 153
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
Support for attaching multiple networks to a vApp #12996
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated, but in line 106 can you change the "AWS" to "VCD"? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,10 +87,10 @@ func (p *Provider) ValidateCloudSpec(_ context.Context, spec kubermaticv1.CloudS | |
} | ||
|
||
// Ensure that the network exists | ||
if spec.VMwareCloudDirector.OVDCNetwork != "" { | ||
_, err := vdc.GetOrgVdcNetworkByNameOrId(spec.VMwareCloudDirector.OVDCNetwork, true) | ||
if spec.VMwareCloudDirector.OVDCNetwork != "" || spec.VMwareCloudDirector.OVDCNetworks != nil { | ||
_, err := getOrgVDCNetworks(vdc, *spec.VMwareCloudDirector) | ||
if err != nil { | ||
return fmt.Errorf("failed to get organization VDC network '%s': %w", client.Auth.VDC, err) | ||
return fmt.Errorf("failed to get organization VDC networks '%s': %w", client.Auth.VDC, err) | ||
} | ||
} | ||
|
||
|
@@ -160,6 +160,13 @@ func (p *Provider) ValidateCloudSpecUpdate(_ context.Context, oldSpec kubermatic | |
if oldSpec.VMwareCloudDirector.OVDCNetwork != newSpec.VMwareCloudDirector.OVDCNetwork { | ||
return fmt.Errorf("updating VMware Cloud Director OVDCNetwork is not supported (was %s, updated to %s)", oldSpec.VMwareCloudDirector.OVDCNetwork, newSpec.VMwareCloudDirector.OVDCNetwork) | ||
} | ||
|
||
if oldSpec.VMwareCloudDirector.OVDCNetworks != nil && newSpec.VMwareCloudDirector.OVDCNetworks != nil { | ||
if len(oldSpec.VMwareCloudDirector.OVDCNetworks) != len(newSpec.VMwareCloudDirector.OVDCNetworks) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this only checking the length? Is changing [a,b] to [c,d] valid? Maybe using a string set's Equal() function would work better here, if not even using a semantic equality. But I'd probably just use a set. |
||
return fmt.Errorf("updating VMware Cloud Director OVDCNetworks is not supported (was %v, updated to %v)", oldSpec.VMwareCloudDirector.OVDCNetworks, newSpec.VMwareCloudDirector.OVDCNetworks) | ||
} | ||
} | ||
|
||
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 don't think we should keep both the old and the new syntax in the conformance-tester's CLI flags. There is no BC guarantee with the tester anyway. We should just have 1 flag, preferably the new one.
Also, this new flag is never set by our code, so the new code isn't tested. Please adjust the hack/ci/run-conformance-tests.sh accordingly.