Skip to content

Commit

Permalink
fix tip output and do not output ending tip disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
sharifelgamal committed Aug 6, 2020
1 parent 16ba55d commit 02930c0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pkg/addons/gcpauth/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ func enableAddon(cfg *config.ClusterConfig) error {
}

out.WarningT("Could not determine a Google Cloud project, which might be ok.")
out.WarningT("If you want it set, either set the GOOGLE_CLOUD_PROJECT environment variable or run `gcloud config set project <project name>`")
out.T(out.Tip, `To set your Google Cloud project, run:
gcloud config set project <project name>
or set the GOOGLE_CLOUD_PROJECT environment variable.`)

// Copy an empty file in to avoid errors about missing files
emptyFile := assets.NewMemoryAssetTarget([]byte{}, projectPath, "0444")
Expand Down Expand Up @@ -113,7 +117,13 @@ func disableAddon(cfg *config.ClusterConfig) error {

// DisplayAddonMessage display an gcp auth addon specific message to the user
func DisplayAddonMessage(cfg *config.ClusterConfig, name string, val string) error {
out.T(out.Notice, "Your GCP credentials will now be mounted into every pod created in the {{.name}} cluster.", out.V{"name": cfg.Name})
out.T(out.Notice, "If you don't want credential mounted into a specific pod, add a label with the `gcp-auth-skip-secret` key to your pod configuration.")
enable, err := strconv.ParseBool(val)
if err != nil {
return errors.Wrapf(err, "parsing bool: %s", name)
}
if enable {
out.T(out.Notice, "Your GCP credentials will now be mounted into every pod created in the {{.name}} cluster.", out.V{"name": cfg.Name})
out.T(out.Notice, "If you don't want your credentials mounted into a specific pod, add a label with the `gcp-auth-skip-secret` key to your pod configuration.")
}
return nil
}

0 comments on commit 02930c0

Please sign in to comment.