diff --git a/cmd/kops/create_cluster.go b/cmd/kops/create_cluster.go index 165ffa7ceb..b886314b61 100644 --- a/cmd/kops/create_cluster.go +++ b/cmd/kops/create_cluster.go @@ -358,7 +358,7 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command { cmd.Flags().StringVar(&options.VSphereDatastore, "vsphere-datastore", options.VSphereDatastore, "vsphere-datastore is required for vSphere. Set a valid datastore in which to store dynamic provision volumes.") } - if featureflag.SpotinstIntegration.Enabled() { + if featureflag.Spotinst.Enabled() { // Spotinst flags cmd.Flags().StringVar(&options.SpotinstProduct, "spotinst-product", options.SpotinstProduct, "Set the product code.") cmd.Flags().StringVar(&options.SpotinstOrientation, "spotinst-orientation", options.SpotinstOrientation, "Set the group orientation.") @@ -852,7 +852,7 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e cluster.Spec.CloudConfig.VSphereDatastore = fi.String(c.VSphereDatastore) } - if featureflag.SpotinstIntegration.Enabled() { + if featureflag.Spotinst.Enabled() { if cluster.Spec.CloudConfig == nil { cluster.Spec.CloudConfig = &api.CloudConfiguration{} } diff --git a/pkg/featureflag/featureflag.go b/pkg/featureflag/featureflag.go index 66d935b95b..a8e053b219 100644 --- a/pkg/featureflag/featureflag.go +++ b/pkg/featureflag/featureflag.go @@ -77,8 +77,8 @@ var GoogleCloudBucketAcl = New("GoogleCloudBucketAcl", Bool(false)) // EnableNodeAuthorization enables the node authorization features var EnableNodeAuthorization = New("EnableNodeAuthorization", Bool(false)) -// SpotinstIntegration toggles the use of Spotinst integration. -var SpotinstIntegration = New("SpotinstIntegration", Bool(false)) +// Spotinst toggles the use of Spotinst integration. +var Spotinst = New("Spotinst", Bool(false)) var flags = make(map[string]*FeatureFlag) var flagsMutex sync.Mutex diff --git a/pkg/resources/aws/aws.go b/pkg/resources/aws/aws.go index 16dbb3b7b3..479cde54e2 100644 --- a/pkg/resources/aws/aws.go +++ b/pkg/resources/aws/aws.go @@ -84,7 +84,7 @@ func ListResourcesAWS(cloud awsup.AWSCloud, clusterName string) (map[string]*res ListIAMRoles, } - if featureflag.SpotinstIntegration.Enabled() { + if featureflag.Spotinst.Enabled() { // Spotinst Elastigroups listFunctions = append(listFunctions, ListSpotinstElastigroups) } else { diff --git a/upup/pkg/fi/cloudup/apply_cluster.go b/upup/pkg/fi/cloudup/apply_cluster.go index 1d22b0bfbf..c37372312e 100644 --- a/upup/pkg/fi/cloudup/apply_cluster.go +++ b/upup/pkg/fi/cloudup/apply_cluster.go @@ -678,7 +678,7 @@ func (c *ApplyClusterCmd) Run() error { KopsModelContext: modelContext, } - if featureflag.SpotinstIntegration.Enabled() { + if featureflag.Spotinst.Enabled() { l.Builders = append(l.Builders, &spotinstmodel.ElastigroupModelBuilder{ AWSModelContext: awsModelContext, BootstrapScript: bootstrapScriptBuilder, diff --git a/upup/pkg/fi/cloudup/awsup/aws_cloud.go b/upup/pkg/fi/cloudup/awsup/aws_cloud.go index bb8e53b044..1f2e15f530 100644 --- a/upup/pkg/fi/cloudup/awsup/aws_cloud.go +++ b/upup/pkg/fi/cloudup/awsup/aws_cloud.go @@ -269,7 +269,7 @@ func NewAWSCloud(region string, tags map[string]string) (AWSCloud, error) { c.route53.Handlers.Send.PushFront(requestLogger) c.addHandlers(region, &c.route53.Handlers) - if featureflag.SpotinstIntegration.Enabled() { + if featureflag.Spotinst.Enabled() { c.spotinst, err = spotinst.NewService(kops.CloudProviderAWS) if err != nil { return c, err diff --git a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go index 43194737dd..5795f7649b 100644 --- a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go +++ b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go @@ -445,7 +445,7 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri } } - if featureflag.SpotinstIntegration.Enabled() { + if featureflag.Spotinst.Enabled() { key := "spotinst-kubernetes-cluster-controller.addons.k8s.io" version := "1.0.16" diff --git a/upup/pkg/fi/cloudup/template_functions.go b/upup/pkg/fi/cloudup/template_functions.go index 97d9ebd276..67fb475bc4 100644 --- a/upup/pkg/fi/cloudup/template_functions.go +++ b/upup/pkg/fi/cloudup/template_functions.go @@ -104,7 +104,7 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS return os.Getenv("DIGITALOCEAN_ACCESS_TOKEN") } - if featureflag.SpotinstIntegration.Enabled() { + if featureflag.Spotinst.Enabled() { if creds, err := spotinst.LoadCredentials(); err == nil { dest["SpotinstToken"] = func() string { return creds.Token } dest["SpotinstAccount"] = func() string { return creds.Account }