Skip to content

Commit

Permalink
Make cloud provider print conditional (#5550)
Browse files Browse the repository at this point in the history
# Description

Today we always print "Configuring Cloud providers"

This PR makes this conditional on if providers have been set.

## Issue reference

<!--
We strive to have all PR being opened based on an issue, where the
problem or feature have been discussed prior to implementation.
-->

Fixes: #5157

## Checklist

Please make sure you've completed the relevant tasks for this PR, out of
the following list:

* [x] Code compiles correctly
* [x] Adds necessary unit tests for change
* [x] Adds necessary E2E tests for change
* [ ] Unit tests passing
* [x] Extended the documentation / Created issue for it
  • Loading branch information
AaronCrawfis authored May 15, 2023
1 parent 473dbdf commit a5d7499
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cli/cmd/radinit/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ func (r *Runner) Run(ctx context.Context) error {
}

// create the providers scope to the environment and register credentials at provider plane
if len(providerList) > 0 {
r.Output.LogInfo("Configuring cloud providers...")
}
providers, err := cmd.CreateEnvProviders(providerList)
if err != nil {
return err
Expand All @@ -421,7 +424,6 @@ func (r *Runner) Run(ctx context.Context) error {
UseDevRecipes: to.Ptr(!r.SkipDevRecipes),
}

r.Output.LogInfo("Configuring Cloud providers")
isEnvCreated, err := client.CreateEnvironment(ctx, r.EnvName, v1.LocationGlobal, &envProperties)
if err != nil || !isEnvCreated {
return &cli.FriendlyError{Message: "Failed to create radius environment"}
Expand Down

0 comments on commit a5d7499

Please sign in to comment.