6767
6868func clusterInit () {
6969 _clusterUpCmd .Flags ().SortFlags = false
70- addAWSCredentialsFlags (_clusterUpCmd )
71- addClusterAWSCredentialsFlags (_clusterUpCmd )
7270 _clusterUpCmd .Flags ().StringVarP (& _flagClusterUpEnv , "configure-env" , "e" , "aws" , "name of environment to configure" )
7371 _clusterUpCmd .Flags ().BoolVarP (& _flagClusterDisallowPrompt , "yes" , "y" , false , "skip prompts" )
7472 _clusterCmd .AddCommand (_clusterUpCmd )
@@ -77,15 +75,12 @@ func clusterInit() {
7775 addClusterConfigFlag (_clusterInfoCmd )
7876 addClusterNameFlag (_clusterInfoCmd )
7977 addClusterRegionFlag (_clusterInfoCmd )
80- addAWSCredentialsFlags (_clusterInfoCmd )
8178 _clusterInfoCmd .Flags ().StringVarP (& _flagClusterInfoEnv , "configure-env" , "e" , "" , "name of environment to configure" )
8279 _clusterInfoCmd .Flags ().BoolVarP (& _flagClusterInfoDebug , "debug" , "d" , false , "save the current cluster state to a file" )
8380 _clusterInfoCmd .Flags ().BoolVarP (& _flagClusterDisallowPrompt , "yes" , "y" , false , "skip prompts" )
8481 _clusterCmd .AddCommand (_clusterInfoCmd )
8582
8683 _clusterConfigureCmd .Flags ().SortFlags = false
87- addAWSCredentialsFlags (_clusterConfigureCmd )
88- addClusterAWSCredentialsFlags (_clusterConfigureCmd )
8984 _clusterConfigureCmd .Flags ().StringVarP (& _flagClusterConfigureEnv , "configure-env" , "e" , "" , "name of environment to configure" )
9085 _clusterConfigureCmd .Flags ().BoolVarP (& _flagClusterDisallowPrompt , "yes" , "y" , false , "skip prompts" )
9186 _clusterCmd .AddCommand (_clusterConfigureCmd )
@@ -94,7 +89,6 @@ func clusterInit() {
9489 addClusterConfigFlag (_clusterDownCmd )
9590 addClusterNameFlag (_clusterDownCmd )
9691 addClusterRegionFlag (_clusterDownCmd )
97- addAWSCredentialsFlags (_clusterDownCmd )
9892 _clusterDownCmd .Flags ().BoolVarP (& _flagClusterDisallowPrompt , "yes" , "y" , false , "skip prompts" )
9993 _clusterDownCmd .Flags ().BoolVar (& _flagClusterDownKeepVolumes , "keep-volumes" , false , "keep cortex provisioned persistent volumes" )
10094 _clusterCmd .AddCommand (_clusterDownCmd )
@@ -103,7 +97,6 @@ func clusterInit() {
10397 addClusterConfigFlag (_clusterExportCmd )
10498 addClusterNameFlag (_clusterExportCmd )
10599 addClusterRegionFlag (_clusterExportCmd )
106- addAWSCredentialsFlags (_clusterExportCmd )
107100 _clusterCmd .AddCommand (_clusterExportCmd )
108101}
109102
@@ -120,16 +113,6 @@ func addClusterRegionFlag(cmd *cobra.Command) {
120113 cmd .Flags ().StringVarP (& _flagClusterRegion , "region" , "r" , "" , "aws region of the cluster" )
121114}
122115
123- func addAWSCredentialsFlags (cmd * cobra.Command ) {
124- cmd .Flags ().StringVar (& _flagAWSAccessKeyID , "aws-key" , "" , "aws access key id" )
125- cmd .Flags ().StringVar (& _flagAWSSecretAccessKey , "aws-secret" , "" , "aws secret access key" )
126- }
127-
128- func addClusterAWSCredentialsFlags (cmd * cobra.Command ) {
129- cmd .Flags ().StringVar (& _flagClusterAWSAccessKeyID , "cluster-aws-key" , "" , "aws access key id to be used by the cluster" )
130- cmd .Flags ().StringVar (& _flagClusterAWSSecretAccessKey , "cluster-aws-secret" , "" , "aws secret access key to be used by the cluster" )
131- }
132-
133116var _clusterCmd = & cobra.Command {
134117 Use : "cluster" ,
135118 Short : "manage AWS clusters (contains subcommands)" ,
@@ -160,11 +143,6 @@ var _clusterUpCmd = &cobra.Command{
160143 exit .Error (err )
161144 }
162145
163- // Deprecation: specifying aws creds in cluster configuration is no longer supported
164- if err := detectAWSCredsInConfigFile (cmd .Use , clusterConfigFile ); err != nil {
165- exit .Error (err )
166- }
167-
168146 accessConfig , err := getNewClusterAccessConfig (clusterConfigFile )
169147 if err != nil {
170148 exit .Error (err )
@@ -325,11 +303,6 @@ var _clusterConfigureCmd = &cobra.Command{
325303 exit .Error (err )
326304 }
327305
328- // Deprecation: specifying aws creds in cluster configuration is no longer supported
329- if err := detectAWSCredsInConfigFile (cmd .Use , clusterConfigFile ); err != nil {
330- exit .Error (err )
331- }
332-
333306 accessConfig , err := getClusterAccessConfigWithCache ()
334307 if err != nil {
335308 exit .Error (err )
@@ -393,11 +366,6 @@ var _clusterInfoCmd = &cobra.Command{
393366 exit .Error (err )
394367 }
395368
396- // Deprecation: specifying aws creds in cluster configuration is no longer supported
397- if err := detectAWSCredsInConfigFile (cmd .Use , _flagClusterConfig ); err != nil {
398- exit .Error (err )
399- }
400-
401369 accessConfig , err := getClusterAccessConfigWithCache ()
402370 if err != nil {
403371 exit .Error (err )
@@ -427,11 +395,6 @@ var _clusterDownCmd = &cobra.Command{
427395 exit .Error (err )
428396 }
429397
430- // Deprecation: specifying aws creds in cluster configuration is no longer supported
431- if err := detectAWSCredsInConfigFile (cmd .Use , _flagClusterConfig ); err != nil {
432- exit .Error (err )
433- }
434-
435398 accessConfig , err := getClusterAccessConfigWithCache ()
436399 if err != nil {
437400 exit .Error (err )
@@ -548,11 +511,6 @@ var _clusterExportCmd = &cobra.Command{
548511 Run : func (cmd * cobra.Command , args []string ) {
549512 telemetry .Event ("cli.cluster.export" , map [string ]interface {}{"provider" : types .AWSProviderType })
550513
551- // Deprecation: specifying aws creds in cluster configuration is no longer supported
552- if err := detectAWSCredsInConfigFile (cmd .Use , _flagClusterConfig ); err != nil {
553- exit .Error (err )
554- }
555-
556514 accessConfig , err := getClusterAccessConfigWithCache ()
557515 if err != nil {
558516 exit .Error (err )
0 commit comments