Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions pkg/asset/manifests/vsphere/cloudproviderconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ vcenter:
`

// expectedYamlConfigWithNodes is used by tests that exercise the yaml path
// with the VSphereMultiNetworks feature gate enabled and a machine network
// CIDR of 10.0.0.0/24 (the fallback path).
// with a machine network CIDR of 10.0.0.0/24 (the fallback path).
expectedYamlConfigWithNodes = `global:
insecureFlag: true
secretName: vsphere-creds
Expand Down Expand Up @@ -260,27 +259,25 @@ func TestCloudProviderConfig(t *testing.T) {
}(),
},
{
// VSphereMultiNetworks is enabled in inDefault() so the nodes
// section is always populated from the machine network CIDR when
// nodeNetworking is not explicitly set.
// The nodes section is always populated from the machine network
// CIDR when nodeNetworking is not explicitly set.
name: "valid out of tree yaml cloud provider config",
platform: validPlatform(),
installConfig: makeInstallConfig(validPlatform(), "", "10.0.0.0/24"),
useYaml: true,
expectedCloudConfig: expectedYamlConfig,
},
{
// TechPreviewNoUpgrade also enables VSphereMultiNetworks – same
// result as the default case above.
// TechPreviewNoUpgrade – same result as the default case above.
name: "valid out of tree yaml cloud provider config with node networking from machine network",
platform: validPlatform(),
installConfig: makeInstallConfig(validPlatform(), configv1.TechPreviewNoUpgrade, "10.0.0.0/24"),
useYaml: true,
expectedCloudConfig: expectedYamlConfigWithNodes,
},
{
// With VSphereMultiNetworks enabled and explicit nodeNetworking set
// in the install-config, the explicit values take precedence.
// With explicit nodeNetworking set in the install-config, the
// explicit values take precedence.
name: "valid out of tree yaml cloud provider config with explicit node networking",
platform: func() *vsphere.Platform {
p := validPlatform()
Expand Down
19 changes: 0 additions & 19 deletions pkg/types/vsphere/validation/featuregates.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,7 @@ import (
func GatedFeatures(c *types.InstallConfig) []featuregates.GatedInstallConfigFeature {
v := c.VSphere

multiNetworksFound := false
nodeNetworkingDefined := v.NodeNetworking != nil

for _, fd := range v.FailureDomains {
if len(fd.Topology.Networks) > 1 {
multiNetworksFound = true
}
}

return []featuregates.GatedInstallConfigFeature{
{
FeatureGateName: features.FeatureGateVSphereMultiNetworks,
Condition: multiNetworksFound,
Field: field.NewPath("platform", "vsphere", "failureDomains", "topology", "networks"),
},
{
FeatureGateName: features.FeatureGateVSphereMultiNetworks,
Condition: nodeNetworkingDefined,
Field: field.NewPath("platform", "vsphere", "nodeNetworking"),
},
{
FeatureGateName: features.FeatureGateOnPremDNSRecords,
Condition: v.DNSRecordsType == configv1.DNSRecordsTypeExternal,
Expand Down