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

     1  package validation
     2  
     3  import (
     4  	"k8s.io/apimachinery/pkg/util/validation/field"
     5  
     6  	features "github.com/openshift/api/features"
     7  	"github.com/openshift/installer/pkg/types"
     8  	"github.com/openshift/installer/pkg/types/featuregates"
     9  	"github.com/openshift/installer/pkg/types/gcp"
    10  )
    11  
    12  // GatedFeatures determines all of the install config fields that should
    13  // be validated to ensure that the proper featuregate is enabled when the field is used.
    14  func GatedFeatures(c *types.InstallConfig) []featuregates.GatedInstallConfigFeature {
    15  	g := c.GCP
    16  	return []featuregates.GatedInstallConfigFeature{
    17  		{
    18  			FeatureGateName: features.FeatureGateGCPLabelsTags,
    19  			Condition:       len(g.UserLabels) > 0,
    20  			Field:           field.NewPath("platform", "gcp", "userLabels"),
    21  		},
    22  		{
    23  			FeatureGateName: features.FeatureGateGCPLabelsTags,
    24  			Condition:       len(g.UserTags) > 0,
    25  			Field:           field.NewPath("platform", "gcp", "userTags"),
    26  		},
    27  		{
    28  			FeatureGateName: features.FeatureGateGCPClusterHostedDNS,
    29  			Condition:       g.UserProvisionedDNS == gcp.UserProvisionedDNSEnabled,
    30  			Field:           field.NewPath("platform", "gcp", "userProvisionedDNS"),
    31  		},
    32  	}
    33  }