diff --git a/cmd/login.go b/cmd/login.go index cefb5ed..31f01ab 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -18,7 +18,7 @@ import ( "errors" "fmt" "syscall" - + "io/ioutil" "github.com/magneticio/vampkubistcli/client" "github.com/magneticio/vampkubistcli/logging" "github.com/magneticio/vampkubistcli/util" @@ -91,6 +91,17 @@ Example: } Config.Cert = CertString } + + tmpfile, tempFileError := ioutil.TempFile("", "tokenstore") + if tempFileError != nil { + logging.Error("Token Store file can not be read due to error: %v\n", tempFileError) + } + + Config.TokenStorePath = tmpfile.Name() + TokenStore = &client.FileBackedTokenStore{ + Path: Config.TokenStorePath, + } + if Token != "" { Config.Token = Token restClient := client.NewRestClient(Config.Url, Config.Token, Config.APIVersion, logging.Verbose, Config.Cert, &TokenStore) @@ -119,8 +130,10 @@ Example: if err != nil { return err } + Config.Token = refreshToken } + Config.Username = Username fmt.Println("Login Successful.") writeConfigError := WriteConfigFile() diff --git a/cmd/root.go b/cmd/root.go index 78f0cfa..e0da54c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -71,12 +71,12 @@ var kubeConfigPath string var TokenStore client.TokenStore // version should be in format d.d.d where d is a decimal number -const Version string = semver.Version //"v0.0.61" +const Version string = semver.Version //"v0.0.63" var AppName string = InitAppName() // Backend version is the version this client is tested with -const BackendVersion string = "0.7.13" +const BackendVersion string = "0.8.17" /* Application name can change over time so it is made parameteric diff --git a/semver/version.go b/semver/version.go index 7105f37..6b4eb44 100644 --- a/semver/version.go +++ b/semver/version.go @@ -1,4 +1,5 @@ package version + // This package is auto generated please don't edit manually -const Version string = "v0.0.62" +const Version string = "v0.0.63"