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

providers/ocmprovider: remove ccs overwrite logic #1383

Merged
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
11 changes: 1 addition & 10 deletions pkg/common/providers/ocmprovider/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,10 @@ func (o *OCMProvider) LaunchCluster(clusterName string) (string, error) {
}
}
} else {
var err error
var ccsUser string
ccsUser, err = aws.VerifyCCS()
_, err = aws.VerifyCCS()
if err != nil {
return "", fmt.Errorf("error verifying CCS credentials: %v", err)
}
log.Printf("ocm.ccs.overwrite is: %v - will attempt to generate CCS keys.", viper.GetString(CCS_OVERWRITE))
if viper.GetBool("ocm.ccs.overwrite") && ccsUser != "osdCcsAdmin" {
awsAccessKey, awsSecretKey, err = aws.CcsScale()
}
if err != nil {
return "", fmt.Errorf("error generating CCS keys: %v", err)
}

newCluster = newCluster.CCS(v1.NewCCS().Enabled(true)).AWS(
v1.NewAWS().
Expand Down
5 changes: 0 additions & 5 deletions pkg/common/providers/ocmprovider/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ const (
// CCS defines whether the cluster should expect cloud credentials or not
CCS = "ocm.ccs"

// CCS_OVERWRITE defines an overwrite flag that will attempt to create CCS credentials for the cluster
CCS_OVERWRITE = "ocm.ccs.overwrite"

// AWSAccount is used in CCS clusters
AWSAccount = "ocm.aws.account"
// AWSAccessKey is used in CCS clusters
Expand Down Expand Up @@ -96,9 +93,7 @@ func init() {
viper.BindEnv(AdditionalLabels, "OCM_ADDITIONAL_LABELS")

viper.SetDefault(CCS, false)
viper.SetDefault(CCS_OVERWRITE, false)
viper.BindEnv(CCS, "OCM_CCS", "CCS")
viper.BindEnv(CCS_OVERWRITE, "CCS_OVERWRITE", "CCS_ADMIN")

viper.BindEnv(AWSAccount, "OCM_AWS_ACCOUNT", "AWS_ACCOUNT")
viper.BindEnv(AWSAccessKey, "OCM_AWS_ACCESS_KEY", "AWS_ACCESS_KEY_ID")
Expand Down