diff --git a/internal/config/config.go b/internal/config/config.go index 1bf2581..24bd707 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -372,7 +372,7 @@ func NewConfig(attrs *Attributes) (*Config, error) { func getFlagNameFromProfile(awsProfile string, flag string) string { profileKey := fmt.Sprintf("%s.%s", awsProfile, flag) - if awsProfile != "" && viper.Get(profileKey) != "" { + if awsProfile != "" && viper.IsSet(profileKey) && viper.Get(profileKey) != "" { // NOTE: If the flag was from a multiple profiles keyed by aws profile // name i.e. `staging.oidc-client-id`, set the base value to that as // well, `oidc-client-id`, such that input validation is satisfied.