Skip to content

Commit

Permalink
Merge pull request #373 from samanthajayasinghe/pd-token-config
Browse files Browse the repository at this point in the history
OSD-21670: Reduce verbosity level of pd-token config
  • Loading branch information
openshift-merge-bot[bot] authored Mar 19, 2024
2 parents 4b19b8e + 01a63b2 commit b415474
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/cli/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ func GetBackplaneConfiguration() (bpConfig BackplaneConfiguration, err error) {
}
}

bpConfig.SessionDirectory = viper.GetString("session-dir")
bpConfig.AssumeInitialArn = viper.GetString("assume-initial-arn")

// proxyURL is optional
// proxyURL is required
proxyInConfigFile := viper.GetStringSlice("proxy-url")
proxyURL := bpConfig.getFirstWorkingProxyURL(proxyInConfigFile)
if proxyURL != "" {
Expand All @@ -95,11 +92,15 @@ func GetBackplaneConfiguration() (bpConfig BackplaneConfiguration, err error) {
logger.Warn("No proxy configuration available. This may result in failing commands as backplane-api is only available from select networks.")
}

bpConfig.SessionDirectory = viper.GetString("session-dir")
bpConfig.AssumeInitialArn = viper.GetString("assume-initial-arn")

// pagerDuty token is optional
pagerDutyAPIKey := viper.GetString("pd-key")
if pagerDutyAPIKey != "" {
bpConfig.PagerDutyAPIKey = pagerDutyAPIKey
} else {
logger.Warn("No PagerDuty API Key configuration available. This will result in failure of `ocm-backplane login --pd <incident-id>` command.")
logger.Info("No PagerDuty API Key configuration available. This will result in failure of `ocm-backplane login --pd <incident-id>` command.")
}

return bpConfig, nil
Expand Down

0 comments on commit b415474

Please sign in to comment.