github.com/openshift/installer@v1.4.17/pkg/types/vsphere/validation/featuregates.go (about)

     1  package validation
     2  
     3  import (
     4  	"k8s.io/apimachinery/pkg/util/validation/field"
     5  
     6  	"github.com/openshift/api/features"
     7  	"github.com/openshift/installer/pkg/types"
     8  	"github.com/openshift/installer/pkg/types/featuregates"
     9  )
    10  
    11  // GatedFeatures determines all of the vSphere install config fields that should
    12  // be validated to ensure that the proper featuregate is enabled when the field is used.
    13  func GatedFeatures(c *types.InstallConfig) []featuregates.GatedInstallConfigFeature {
    14  	v := c.VSphere
    15  	return []featuregates.GatedInstallConfigFeature{
    16  		{
    17  			FeatureGateName: features.FeatureGateVSphereStaticIPs,
    18  			Condition:       len(v.Hosts) > 0,
    19  			Field:           field.NewPath("platform", "vsphere", "hosts"),
    20  		},
    21  		{
    22  			FeatureGateName: features.FeatureGateVSphereMultiVCenters,
    23  			Condition:       len(v.VCenters) > 1,
    24  			Field:           field.NewPath("platform", "vsphere", "vcenters"),
    25  		},
    26  	}
    27  }