From 4f207e4ac344a7551696a1206293fa060d0f182a Mon Sep 17 00:00:00 2001 From: liranp Date: Thu, 7 May 2020 17:51:33 +0300 Subject: [PATCH] feat(spotinst): allow users to disable the controller addon --- pkg/featureflag/featureflag.go | 2 ++ upup/pkg/fi/cloudup/bootstrapchannelbuilder.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/featureflag/featureflag.go b/pkg/featureflag/featureflag.go index 942d3a4ca64df..637f72f61b7fe 100644 --- a/pkg/featureflag/featureflag.go +++ b/pkg/featureflag/featureflag.go @@ -76,6 +76,8 @@ var ( Spotinst = New("Spotinst", Bool(false)) // SpotinstOcean toggles the use of Spotinst Ocean instance group implementation. SpotinstOcean = New("SpotinstOcean", Bool(false)) + // SpotinstController toggles the installation of the Spotinst controller addon. + SpotinstController = New("SpotinstController", Bool(true)) // VPCSkipEnableDNSSupport if set will make that a VPC does not need DNSSupport enabled. VPCSkipEnableDNSSupport = New("VPCSkipEnableDNSSupport", Bool(false)) // VSphereCloudProvider enables the vsphere cloud provider diff --git a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go index 36afeb034272d..20bce40d7513b 100644 --- a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go +++ b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go @@ -543,7 +543,7 @@ func (b *BootstrapChannelBuilder) buildAddons() *channelsapi.Addons { } } - if featureflag.Spotinst.Enabled() { + if featureflag.Spotinst.Enabled() && featureflag.SpotinstController.Enabled() { key := "spotinst-kubernetes-cluster-controller.addons.k8s.io" {