67
67
68
68
func clusterInit () {
69
69
_clusterUpCmd .Flags ().SortFlags = false
70
- addAWSCredentialsFlags (_clusterUpCmd )
71
- addClusterAWSCredentialsFlags (_clusterUpCmd )
72
70
_clusterUpCmd .Flags ().StringVarP (& _flagClusterUpEnv , "configure-env" , "e" , "aws" , "name of environment to configure" )
73
71
_clusterUpCmd .Flags ().BoolVarP (& _flagClusterDisallowPrompt , "yes" , "y" , false , "skip prompts" )
74
72
_clusterCmd .AddCommand (_clusterUpCmd )
@@ -77,15 +75,12 @@ func clusterInit() {
77
75
addClusterConfigFlag (_clusterInfoCmd )
78
76
addClusterNameFlag (_clusterInfoCmd )
79
77
addClusterRegionFlag (_clusterInfoCmd )
80
- addAWSCredentialsFlags (_clusterInfoCmd )
81
78
_clusterInfoCmd .Flags ().StringVarP (& _flagClusterInfoEnv , "configure-env" , "e" , "" , "name of environment to configure" )
82
79
_clusterInfoCmd .Flags ().BoolVarP (& _flagClusterInfoDebug , "debug" , "d" , false , "save the current cluster state to a file" )
83
80
_clusterInfoCmd .Flags ().BoolVarP (& _flagClusterDisallowPrompt , "yes" , "y" , false , "skip prompts" )
84
81
_clusterCmd .AddCommand (_clusterInfoCmd )
85
82
86
83
_clusterConfigureCmd .Flags ().SortFlags = false
87
- addAWSCredentialsFlags (_clusterConfigureCmd )
88
- addClusterAWSCredentialsFlags (_clusterConfigureCmd )
89
84
_clusterConfigureCmd .Flags ().StringVarP (& _flagClusterConfigureEnv , "configure-env" , "e" , "" , "name of environment to configure" )
90
85
_clusterConfigureCmd .Flags ().BoolVarP (& _flagClusterDisallowPrompt , "yes" , "y" , false , "skip prompts" )
91
86
_clusterCmd .AddCommand (_clusterConfigureCmd )
@@ -94,7 +89,6 @@ func clusterInit() {
94
89
addClusterConfigFlag (_clusterDownCmd )
95
90
addClusterNameFlag (_clusterDownCmd )
96
91
addClusterRegionFlag (_clusterDownCmd )
97
- addAWSCredentialsFlags (_clusterDownCmd )
98
92
_clusterDownCmd .Flags ().BoolVarP (& _flagClusterDisallowPrompt , "yes" , "y" , false , "skip prompts" )
99
93
_clusterDownCmd .Flags ().BoolVar (& _flagClusterDownKeepVolumes , "keep-volumes" , false , "keep cortex provisioned persistent volumes" )
100
94
_clusterCmd .AddCommand (_clusterDownCmd )
@@ -103,7 +97,6 @@ func clusterInit() {
103
97
addClusterConfigFlag (_clusterExportCmd )
104
98
addClusterNameFlag (_clusterExportCmd )
105
99
addClusterRegionFlag (_clusterExportCmd )
106
- addAWSCredentialsFlags (_clusterExportCmd )
107
100
_clusterCmd .AddCommand (_clusterExportCmd )
108
101
}
109
102
@@ -120,16 +113,6 @@ func addClusterRegionFlag(cmd *cobra.Command) {
120
113
cmd .Flags ().StringVarP (& _flagClusterRegion , "region" , "r" , "" , "aws region of the cluster" )
121
114
}
122
115
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
-
133
116
var _clusterCmd = & cobra.Command {
134
117
Use : "cluster" ,
135
118
Short : "manage AWS clusters (contains subcommands)" ,
@@ -160,11 +143,6 @@ var _clusterUpCmd = &cobra.Command{
160
143
exit .Error (err )
161
144
}
162
145
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
-
168
146
accessConfig , err := getNewClusterAccessConfig (clusterConfigFile )
169
147
if err != nil {
170
148
exit .Error (err )
@@ -325,11 +303,6 @@ var _clusterConfigureCmd = &cobra.Command{
325
303
exit .Error (err )
326
304
}
327
305
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
-
333
306
accessConfig , err := getClusterAccessConfigWithCache ()
334
307
if err != nil {
335
308
exit .Error (err )
@@ -393,11 +366,6 @@ var _clusterInfoCmd = &cobra.Command{
393
366
exit .Error (err )
394
367
}
395
368
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
-
401
369
accessConfig , err := getClusterAccessConfigWithCache ()
402
370
if err != nil {
403
371
exit .Error (err )
@@ -427,11 +395,6 @@ var _clusterDownCmd = &cobra.Command{
427
395
exit .Error (err )
428
396
}
429
397
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
-
435
398
accessConfig , err := getClusterAccessConfigWithCache ()
436
399
if err != nil {
437
400
exit .Error (err )
@@ -548,11 +511,6 @@ var _clusterExportCmd = &cobra.Command{
548
511
Run : func (cmd * cobra.Command , args []string ) {
549
512
telemetry .Event ("cli.cluster.export" , map [string ]interface {}{"provider" : types .AWSProviderType })
550
513
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
-
556
514
accessConfig , err := getClusterAccessConfigWithCache ()
557
515
if err != nil {
558
516
exit .Error (err )
0 commit comments