Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check for env KUBE_PS1_CLUSTER_FUNCTION #37

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/ocm-backplane/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ var (
backplaneURL string
}
)
// Environment variable that for setting PS1
const EnvPs1 = "KUBE_PS1_CLUSTER_FUNCTION"

// LoginCmd represents the login command
var LoginCmd = &cobra.Command{
Expand Down Expand Up @@ -114,7 +116,13 @@ func runLogin(cmd *cobra.Command, argv []string) (err error) {
if err != nil {
return err
}
// Check PS1 env is set or not

EnvPs1 , ok := os.LookupEnv(EnvPs1);
if !ok {
logger.Warn("Env KUBE_PS1_CLUSTER_FUNCTION is not detected. It is recommended to set PS1 to learn which cluster you are operating on, refer https://github.com/openshift/backplane-cli/blob/main/docs/PS1-setup.md. ", EnvPs1)
}

// Add a new cluster & context & user
logger.Debugln("Writing OCM configuration ")

Expand Down