diff --git a/cmd/account/mgmt/account-unassign_test.go b/cmd/account/mgmt/account-unassign_test.go index 60a65627..f12e6f2d 100644 --- a/cmd/account/mgmt/account-unassign_test.go +++ b/cmd/account/mgmt/account-unassign_test.go @@ -21,8 +21,7 @@ import ( ) func TestAssumeRoleForAccount(t *testing.T) { - viper.Set(awsInternal.ProxyConfigKey, "") - viper.Set(awsInternal.SkipProxyCheckKey, true) + viper.Set(awsInternal.ProxyConfigKey, "a-random-proxy") mocks := setupDefaultMocks(t, []runtime.Object{}) mockAWSClient := mock.NewMockClient(mocks.mockCtrl) diff --git a/pkg/provider/aws/client.go b/pkg/provider/aws/client.go index 4cd48907..e9f91c2b 100644 --- a/pkg/provider/aws/client.go +++ b/pkg/provider/aws/client.go @@ -45,7 +45,6 @@ type AwsClientInput struct { } const ProxyConfigKey = "aws_proxy" -const SkipProxyCheckKey = "skip_aws_proxy_check" // TODO: Add more methods when needed type Client interface { @@ -140,15 +139,13 @@ type AwsClient struct { func addProxyConfigToSessionOptConfig(config *aws.Config) { awsProxyUrl := viper.GetString(ProxyConfigKey) if awsProxyUrl == "" { - _, _ = fmt.Fprintf(os.Stderr, "[WARNING] `%s` not configured. Please add this to your osdctl configuration to ensure traffic is routed though a proxy.\n", ProxyConfigKey) - if skipAwsProxyCheck := viper.GetBool(SkipProxyCheckKey); !skipAwsProxyCheck { - _, _ = fmt.Fprint(os.Stderr, "Please confirm that you would like to continue with [y|N] ") - var input string - _, _ = fmt.Scanln(&input) - if strings.ToLower(input) != "y" { - _, _ = fmt.Fprintln(os.Stderr, "Must enter 'y' to continue; exiting...") - os.Exit(0) - } + _, _ = fmt.Fprintf(os.Stderr, "[ERROR] `%s` not configured. Please add this to your osdctl configuration to ensure traffic is routed though a proxy.\n", ProxyConfigKey) + _, _ = fmt.Fprint(os.Stderr, "Please confirm that you would like to continue with [y|N] ") + var input string + _, _ = fmt.Scanln(&input) + if strings.ToLower(input) != "y" { + _, _ = fmt.Fprintln(os.Stderr, "Must enter 'y' to continue; exiting...") + os.Exit(0) } } else { config.HTTPClient = &http.Client{