Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Remove WCP_Simplified_Enablement FSS #819

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
2 changes: 0 additions & 2 deletions config/local/vmoperator/local_env_var_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ spec:
value: "false"
- name: FSS_WCP_SUPERVISOR_ASYNC_UPGRADE
value: "false"
- name: FSS_WCP_SIMPLIFIED_ENABLEMENT
value: "false"

#
# Feature state switch flags beneath this line are enabled on main and
Expand Down
6 changes: 0 additions & 6 deletions config/wcp/vmoperator/manager_env_var_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@
name: FSS_WCP_SUPERVISOR_ASYNC_UPGRADE
value: "<FSS_WCP_SUPERVISOR_ASYNC_UPGRADE_VALUE>"

- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: FSS_WCP_SIMPLIFIED_ENABLEMENT
value: "<FSS_WCP_SIMPLIFIED_ENABLEMENT_VALUE>"

#
# Feature state switch flags beneath this line are enabled on main and only
# retained in this file because it is used by internal testing to determine the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3"
webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1"
appv1a1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/v1alpha1"
pkgcfg "github.com/vmware-tanzu/vm-operator/pkg/config"
"github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels"
pkgctx "github.com/vmware-tanzu/vm-operator/pkg/context"
providerfake "github.com/vmware-tanzu/vm-operator/pkg/providers/fake"
Expand Down Expand Up @@ -146,14 +145,7 @@ func unitTestsReconcile() {
Expect(wcrCtx.WebConsoleRequest.Labels).To(HaveKey(webconsolerequest.UUIDLabelKey))
})

When("SimplifiedEnablement is enabled", func() {
JustBeforeEach(func() {
pkgcfg.UpdateContext(ctx,
func(config *pkgcfg.Config) {
config.Features.SimplifiedEnablement = true
},
)
})
When("Web Console returns correct proxy address", func() {

DescribeTable("DNS Names",
func(apiServerDNSName []string, expectedProxy string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha3"
webconsolerequest "github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2"
appv1a1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/v1alpha1"
pkgcfg "github.com/vmware-tanzu/vm-operator/pkg/config"
"github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels"
pkgctx "github.com/vmware-tanzu/vm-operator/pkg/context"
providerfake "github.com/vmware-tanzu/vm-operator/pkg/providers/fake"
Expand Down Expand Up @@ -136,14 +135,7 @@ func unitTestsReconcile() {
})
})

When("SimplifiedEnablement is enabled", func() {
JustBeforeEach(func() {
pkgcfg.UpdateContext(ctx,
func(config *pkgcfg.Config) {
config.Features.SimplifiedEnablement = true
},
)
})
When("Web Console returns correct proxy address", func() {

DescribeTable("DNS Names",
func(apiServerDNSName []string, expectedProxy string) {
Expand Down
1 change: 0 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ type FeatureStates struct {
VMIncrementalRestore bool // FSS_WCP_VMSERVICE_INCREMENTAL_RESTORE
BringYourOwnEncryptionKey bool // FSS_WCP_VMSERVICE_BYOK
SVAsyncUpgrade bool // FSS_WCP_SUPERVISOR_ASYNC_UPGRADE
SimplifiedEnablement bool // FSS_WCP_SIMPLIFIED_ENABLEMENT
}

type InstanceStorage struct {
Expand Down
1 change: 0 additions & 1 deletion pkg/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func FromEnv() Config {
setBool(env.FSSVMImportNewNet, &config.Features.VMImportNewNet)
setBool(env.FSSVMIncrementalRestore, &config.Features.VMIncrementalRestore)
setBool(env.FSSBringYourOwnEncryptionKey, &config.Features.BringYourOwnEncryptionKey)
setBool(env.FSSSimplifiedEnablement, &config.Features.SimplifiedEnablement)

setBool(env.FSSSVAsyncUpgrade, &config.Features.SVAsyncUpgrade)
if !config.Features.SVAsyncUpgrade {
Expand Down
3 changes: 0 additions & 3 deletions pkg/config/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const (
FSSVMIncrementalRestore
FSSBringYourOwnEncryptionKey
FSSSVAsyncUpgrade
FSSSimplifiedEnablement

_varNameEnd
)
Expand Down Expand Up @@ -177,8 +176,6 @@ func (n VarName) String() string {
return "FSS_WCP_VMSERVICE_BYOK"
case FSSSVAsyncUpgrade:
return "FSS_WCP_SUPERVISOR_ASYNC_UPGRADE"
case FSSSimplifiedEnablement:
return "FSS_WCP_SIMPLIFIED_ENABLEMENT"
}
panic("unknown environment variable")
}
2 changes: 0 additions & 2 deletions pkg/config/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ var _ = Describe(
Expect(os.Setenv("FSS_WCP_VMSERVICE_INCREMENTAL_RESTORE", "true")).To(Succeed())
Expect(os.Setenv("FSS_WCP_VMSERVICE_BYOK", "true")).To(Succeed())
Expect(os.Setenv("FSS_WCP_SUPERVISOR_ASYNC_UPGRADE", "false")).To(Succeed())
Expect(os.Setenv("FSS_WCP_SIMPLIFIED_ENABLEMENT", "true")).To(Succeed())
Expect(os.Setenv("CREATE_VM_REQUEUE_DELAY", "125h")).To(Succeed())
Expect(os.Setenv("POWERED_ON_VM_HAS_IP_REQUEUE_DELAY", "126h")).To(Succeed())
})
Expand Down Expand Up @@ -151,7 +150,6 @@ var _ = Describe(
BringYourOwnEncryptionKey: true,
SVAsyncUpgrade: false, // Capability gate so tested below
WorkloadDomainIsolation: true,
SimplifiedEnablement: true,
},
CreateVMRequeueDelay: 125 * time.Hour,
PoweredOnVMHasIPRequeueDelay: 126 * time.Hour,
Expand Down
5 changes: 0 additions & 5 deletions pkg/util/kube/proxyaddr/proxy_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

appv1a1 "github.com/vmware-tanzu/vm-operator/external/appplatform/api/v1alpha1"
pkgcfg "github.com/vmware-tanzu/vm-operator/pkg/config"
)

const (
Expand All @@ -28,10 +27,6 @@ const (
// ProxyAddress first attempts to get the proxy address through the API Server DNS Names.
// If that is unset, though, fall back to using the virtual IP.
func ProxyAddress(ctx context.Context, r client.Client) (string, error) {
if !pkgcfg.FromContext(ctx).Features.SimplifiedEnablement {
return proxyAddressFromVirtualIP(ctx, r)
}

// Attempt to use the API Server DNS Names to get the proxy address.
proxyAddress, err := proxyServiceDNSName(ctx, r)
if err != nil {
Expand Down
32 changes: 0 additions & 32 deletions pkg/util/kube/proxyaddr/proxy_address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,6 @@ var _ = Describe("Test Proxy Address", func() {
withFuncs, initialObjects...)
})

When("Simplified Enablement FSS is disabled", func() {
BeforeEach(func() {
api = &appv1a1.SupervisorProperties{
ObjectMeta: metav1.ObjectMeta{
Name: "supervisor-env-props",
Namespace: "vmware-system-supervisor-services",
},
Spec: appv1a1.SupervisorPropertiesSpec{
APIServerDNSNames: []string{apiServerDNSName},
},
}
ctx = pkgcfg.UpdateContext(ctx, func(config *pkgcfg.Config) {
config.Features.SimplifiedEnablement = false
})

initialObjects = []ctrlclient.Object{proxySvc, api}
})

It("Should always return the virtual IP", func() {
str, err := ProxyAddress(ctx, client)
Expect(err).ToNot(HaveOccurred())
Expect(str).To(Equal(virtualIP))
})

})

When("API Server DNS Names is NOT set", func() {
BeforeEach(func() {
api = &appv1a1.SupervisorProperties{
Expand All @@ -98,9 +72,6 @@ var _ = Describe("Test Proxy Address", func() {
APIServerDNSNames: []string{},
},
}
ctx = pkgcfg.UpdateContext(ctx, func(config *pkgcfg.Config) {
config.Features.SimplifiedEnablement = true
})

initialObjects = []ctrlclient.Object{proxySvc, api}
})
Expand All @@ -124,9 +95,6 @@ var _ = Describe("Test Proxy Address", func() {
APIServerDNSNames: []string{apiServerDNSName},
},
}
ctx = pkgcfg.UpdateContext(ctx, func(config *pkgcfg.Config) {
config.Features.SimplifiedEnablement = true
})

initialObjects = []ctrlclient.Object{proxySvc, api}
})
Expand Down
Loading