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

These changes are for cloud-ctl error lablels #405

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
var (
REGION_INVALID error = errors.New("Invalid Region")
INVALID_CREDS error = errors.New("Invalid Credentials")
NO_CONFIG = errors.New("No config found, please create with `pf9ctl config set`")
NO_CONFIG = errors.New(fmt.Sprintf("No config found, please create with `%s config set`", util.Ctl))
MISSSING_FIELDS = errors.New("Missing mandatory field(s) (Platform9 Account URL/Username/Password/Region/Tenant)")
MAX_ATTEMPTS_ERROR = errors.New("Invalid credentials entered multiple times (Platform9 Account URL/Username/Password/Region/Tenant/Proxy URL/MFA Token)")
)
Expand Down Expand Up @@ -369,7 +369,7 @@ func createClient(cfg *objects.Config, nc objects.NodeConfig) (client.Client, er
return client.NewClient(cfg.Fqdn, executor, cfg.AllowInsecure, false)
}

//This function clears the context if it is invalid. Before storing it.
// This function clears the context if it is invalid. Before storing it.
func clearContext(v interface{}) {
p := reflect.ValueOf(v).Elem()
p.Set(reflect.Zero(p.Type()))
Expand Down
7 changes: 5 additions & 2 deletions pkg/util/constants.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package util

import (
"fmt"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -62,13 +63,15 @@ const (
PmkVersion = "1.20.11"
Docker = "docker"
Calico = "calico"

Ctl = "pf9ctl"
)

var (
// Constants for check failure messages
PyCliErr = "Earlier version of pf9ctl already exists. This must be uninstalled."
PyCliErr = fmt.Sprintf("Earlier version of %s already exists. This must be uninstalled.", Ctl)
ExisitngInstallationErr = "Platform9 packages already exist. These must be uninstalled."
SudoErr = "User running pf9ctl must have privilege (sudo) mode enabled."
SudoErr = fmt.Sprintf("User running %s must have privilege (sudo) mode enabled.", Ctl)
OSPackagesErr = "Some OS packages needed for the CLI not found"
CPUErr = "At least 2 CPUs are needed on host."
DiskErr = "At least 30 GB of total disk space and 15 GB of free space is needed on host."
Expand Down
Loading