Skip to content

Commit

Permalink
ARO-6756 Remove usecheckaccess feature and variables (#3643)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeepc2792 authored Jul 23, 2024
1 parent 53691de commit 0684a5a
Show file tree
Hide file tree
Showing 15 changed files with 5 additions and 65 deletions.
4 changes: 0 additions & 4 deletions pkg/api/featureflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@ const (
// Unit (MTU) on Azure virtual networks, which as of late 2021 is 3900 bytes.
// Otherwise cluster nodes will use the DHCP-provided MTU of 1500 bytes.
FeatureFlagMTU3900 = "Microsoft.RedHatOpenShift/MTU3900"

// FeatureFlagCheckAccessTestToggle is used for safely testing the new check access
// API in production. The toggle will be removed once the testing has been completed.
FeatureFlagCheckAccessTestToggle = "Microsoft.RedHatOpenShift/CheckAccessTestToggle"
)
2 changes: 1 addition & 1 deletion pkg/backend/openshiftcluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ func TestBackendTry(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
ctx := context.Background()
log := logrus.NewEntry(logrus.StandardLogger())
tlc := testliveconfig.NewTestLiveConfig(false, false, false)
tlc := testliveconfig.NewTestLiveConfig(false, false)

controller := gomock.NewController(t)
defer controller.Finish()
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/install_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestGetOpenShiftVersionFromVersion(t *testing.T) {
controller := gomock.NewController(t)
defer controller.Finish()

tlc := testliveconfig.NewTestLiveConfig(false, false, false)
tlc := testliveconfig.NewTestLiveConfig(false, false)
_env := mock_env.NewMockInterface(controller)
_env.EXPECT().ACRDomain().AnyTimes().Return(testACRDomain)
_env.EXPECT().LiveConfig().AnyTimes().Return(tlc)
Expand Down
3 changes: 0 additions & 3 deletions pkg/deploy/assets/rp-production-parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@
"subscriptionResourceGroupName": {
"value": ""
},
"useCheckAccess": {
"value": ""
},
"vmSize": {
"value": "Standard_D2s_v3"
},
Expand Down
6 changes: 1 addition & 5 deletions pkg/deploy/assets/rp-production.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pkg/deploy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ type Configuration struct {
InstallViaHive *string `json:"clustersInstallViaHive,omitempty"`
DefaultInstallerPullspec *string `json:"clusterDefaultInstallerPullspec,omitempty"`
AdoptByHive *string `json:"clustersAdoptByHive,omitempty"`
UseCheckAccess *string `json:"useCheckAccess,omitempty"`
}

// Note: if this configuration block is provided, all throughputs must be present and valid
Expand Down
3 changes: 0 additions & 3 deletions pkg/deploy/devconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ func DevConfig(_env env.Core) (*Config, error) {
InstallViaHive: to.StringPtr(os.Getenv("ARO_INSTALL_VIA_HIVE")),
DefaultInstallerPullspec: to.StringPtr(os.Getenv("ARO_HIVE_DEFAULT_INSTALLER_PULLSPEC")),
AdoptByHive: to.StringPtr(os.Getenv("ARO_ADOPT_BY_HIVE")),
// TODO Remove when CheckAccess is completely rolled out
// Start enabling this in Dev
UseCheckAccess: to.StringPtr(os.Getenv("USE_CHECKACCESS")),
},
}, nil
}
1 change: 0 additions & 1 deletion pkg/deploy/generator/resources_rp.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ func (g *generator) rpVMSS() *arm.Resource {
"clustersInstallViaHive",
"clustersAdoptByHive",
"clusterDefaultInstallerPullspec",
"useCheckAccess",
} {
parts = append(parts,
fmt.Sprintf("'%s=$(base64 -d <<<'''", strings.ToUpper(variable)),
Expand Down
2 changes: 0 additions & 2 deletions pkg/deploy/generator/scripts/rpVMSS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ RPIMAGE='$RPIMAGE'
ARO_INSTALL_VIA_HIVE='$CLUSTERSINSTALLVIAHIVE'
ARO_HIVE_DEFAULT_INSTALLER_PULLSPEC='$CLUSTERDEFAULTINSTALLERPULLSPEC'
ARO_ADOPT_BY_HIVE='$CLUSTERSADOPTBYHIVE'
USE_CHECKACCESS='$USECHECKACCESS'
OIDC_AFD_ENDPOINT='$LOCATION.oic.$RPPARENTDOMAINNAME'
OIDC_STORAGE_ACCOUNT_NAME='$OIDCSTORAGEACCOUNTNAME'
EOF
Expand Down Expand Up @@ -341,7 +340,6 @@ ExecStart=/usr/bin/docker run \
-e ARO_INSTALL_VIA_HIVE \
-e ARO_HIVE_DEFAULT_INSTALLER_PULLSPEC \
-e ARO_ADOPT_BY_HIVE \
-e USE_CHECKACCESS \
-e OIDC_AFD_ENDPOINT \
-e OIDC_STORAGE_ACCOUNT_NAME \
-m 2g \
Expand Down
4 changes: 1 addition & 3 deletions pkg/deploy/generator/templates_rp.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (g *generator) rpTemplate() *arm.Template {
"clustersInstallViaHive",
"clusterDefaultInstallerPullspec",
"clustersAdoptByHive",
"useCheckAccess",
)
}

Expand Down Expand Up @@ -137,8 +136,7 @@ func (g *generator) rpTemplate() *arm.Template {
// TODO: Replace with Live Service Configuration in KeyVault
case "clustersInstallViaHive",
"clustersAdoptByHive",
"clusterDefaultInstallerPullspec",
"useCheckAccess":
"clusterDefaultInstallerPullspec":
p.DefaultValue = ""
}
t.Parameters[param] = p
Expand Down
18 changes: 0 additions & 18 deletions pkg/util/liveconfig/checkaccess.go

This file was deleted.

8 changes: 0 additions & 8 deletions pkg/util/liveconfig/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,3 @@ func (p *dev) AdoptByHive(ctx context.Context) (bool, error) {
}
return false, nil
}

func (d *dev) UseCheckAccess(ctx context.Context) (bool, error) {
checkAccess := os.Getenv(useCheckAccess)
if checkAccess == "enabled" {
return true, nil
}
return false, nil
}
2 changes: 0 additions & 2 deletions pkg/util/liveconfig/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ const (
hiveInstallerEnableEnvVar = "ARO_INSTALL_VIA_HIVE"
hiveDefaultPullSpecEnvVar = "ARO_HIVE_DEFAULT_INSTALLER_PULLSPEC"
hiveAdoptEnableEnvVar = "ARO_ADOPT_BY_HIVE"
useCheckAccess = "USE_CHECKACCESS"
)

type Manager interface {
HiveRestConfig(context.Context, int) (*rest.Config, error)
InstallViaHive(context.Context) (bool, error)
AdoptByHive(context.Context) (bool, error)
UseCheckAccess(context.Context) (bool, error)

// Allows overriding the default installer pullspec for Prod, if the OpenShiftVersions database is not populated
DefaultInstallerPullSpecOverride(context.Context) string
Expand Down
6 changes: 0 additions & 6 deletions pkg/validate/openshiftcluster_validatedynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ func (dv *openShiftClusterDynamicValidator) Dynamic(ctx context.Context) error {
return err
}

useCheckAccess, err := dv.env.LiveConfig().UseCheckAccess(ctx)
dv.log.Info("USE_CHECKACCESS: ", useCheckAccess)
if err != nil {
return err
}

aroEnv := dv.env.Environment()
pdpClient = remotepdp.NewRemotePDPClient(
fmt.Sprintf(aroEnv.Endpoint, dv.env.Location()),
Expand Down
8 changes: 1 addition & 7 deletions test/util/testliveconfig/liveconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
type testLiveConfig struct {
adoptByHive bool
installViaHive bool
useCheckAccess bool
}

func (t *testLiveConfig) HiveRestConfig(ctx context.Context, shard int) (*rest.Config, error) {
Expand All @@ -33,21 +32,16 @@ func (t *testLiveConfig) AdoptByHive(ctx context.Context) (bool, error) {
return t.adoptByHive, nil
}

func (t *testLiveConfig) UseCheckAccess(ctx context.Context) (bool, error) {
return t.useCheckAccess, nil
}

func (t *testLiveConfig) DefaultInstallerPullSpecOverride(ctx context.Context) string {
if t.installViaHive {
return "example/pull:spec"
}
return ""
}

func NewTestLiveConfig(adoptByHive, installViaHive, useCheckAccess bool) liveconfig.Manager {
func NewTestLiveConfig(adoptByHive, installViaHive bool) liveconfig.Manager {
return &testLiveConfig{
adoptByHive: adoptByHive,
installViaHive: installViaHive,
useCheckAccess: useCheckAccess,
}
}

0 comments on commit 0684a5a

Please sign in to comment.