File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -236,18 +236,22 @@ func validateMissingS3Options(options *types.Options) []string {
236236 missing = append (missing , "AWS_TEMPLATE_BUCKET" )
237237 }
238238 if options .AwsProfile == "" {
239+ var missingCreds []string
239240 if options .AwsAccessKey == "" {
240- missing = append (missing , "AWS_ACCESS_KEY" )
241+ missingCreds = append (missingCreds , "AWS_ACCESS_KEY" )
241242 }
242243 if options .AwsSecretKey == "" {
243- missing = append (missing , "AWS_SECRET_KEY" )
244+ missingCreds = append (missingCreds , "AWS_SECRET_KEY" )
244245 }
245246 if options .AwsRegion == "" {
246- missing = append (missing , "AWS_REGION" )
247+ missingCreds = append (missingCreds , "AWS_REGION" )
248+ }
249+
250+ missing = append (missing , missingCreds ... )
251+
252+ if len (missingCreds ) > 0 {
253+ missing = append (missing , "AWS_PROFILE" )
247254 }
248- }
249- if (options .AwsAccessKey == "" || options .AwsSecretKey == "" || options .AwsRegion == "" ) && options .AwsProfile == "" {
250- missing = append (missing , "AWS_PROFILE" )
251255 }
252256
253257 return missing
You can’t perform that action at this time.
0 commit comments