diff --git a/client/client.go b/client/client.go index fb1298d..71a90b8 100644 --- a/client/client.go +++ b/client/client.go @@ -26,6 +26,7 @@ import ( "time" "github.com/ghodss/yaml" + "github.com/magneticio/vampkubistcli/logging" "github.com/magneticio/vampkubistcli/models" "gopkg.in/resty.v1" ) @@ -95,8 +96,14 @@ type authSuccess struct { RefreshToken string `json:"refresh_token"` } +const defaultVersion = "v1" + func NewRestClient(url string, token string, version string, isVerbose bool, cert string) *restClient { resty.SetDebug(isVerbose) + if version == "" { + logging.Info("Using Default Version for client: %s\n", defaultVersion) + version = defaultVersion + } if cert != "" { // Create our Temp File: This will create a filename like /tmp/prefix-123456 // We can use a pattern of "pre-*.txt" to get an extension like: /tmp/pre-123456.txt diff --git a/cmd/root.go b/cmd/root.go index 4b37b2b..5f6d985 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -58,7 +58,7 @@ var OutputType string var Hosts []string // version should be in format d.d.d where d is a decimal number -const Version string = "0.0.20" +const Version string = "0.0.21" const AppName string = "vamp" // Backend version is the version this client is tested with