Skip to content

Commit

Permalink
Fix formatting of a couple error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cblecker committed Jun 19, 2023
1 parent 54f57fc commit abaefae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/ocm-backplane/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ var (
Use: "login <CLUSTERID|EXTERNAL_ID|CLUSTER_NAME|CLUSTER_NAME_SEARCH>",
Short: "Login to a target cluster",
Long: `Running login command will send a request to backplane api
using OCM token. The backplane api will return a proxy url for
target cluster. The url will be written to kubeconfig, so we can
using OCM token. The backplane api will return a proxy url for
target cluster. The url will be written to kubeconfig, so we can
run oc command later to operate the target cluster.`,
Example: " backplane login <id>\n backplane login %test%\n backplane login <external_id>",
Args: cobra.ExactArgs(1),
Expand Down Expand Up @@ -211,7 +211,7 @@ func runLogin(cmd *cobra.Command, argv []string) (err error) {
// Check API connection with configured proxy
err = bpConfig.CheckAPIConnection()
if err != nil {
return fmt.Errorf("cannot connect to backplane API URL,Check if you need to use a proxy/VPN to access backplane. error: %v", err)
return fmt.Errorf("cannot connect to backplane API URL, check if you need to use a proxy/VPN to access backplane: %v", err)
}

// Otherwise, return the failure
Expand All @@ -228,7 +228,7 @@ func runLogin(cmd *cobra.Command, argv []string) (err error) {

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)
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
Expand Down
2 changes: 1 addition & 1 deletion cmd/ocm-backplane/login/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ var _ = Describe("Login command", func() {
err = runLogin(nil, []string{testClusterId})

Expect(err).NotTo(BeNil())
Expect(err.Error()).Should(ContainSubstring("Check if you need to use a proxy/VPN to access backplane"))
Expect(err.Error()).Should(ContainSubstring("check if you need to use a proxy/VPN to access backplane"))

})

Expand Down

0 comments on commit abaefae

Please sign in to comment.