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

Fix fetch #386

Merged
merged 4 commits into from
Jun 2, 2020
Merged
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
6 changes: 1 addition & 5 deletions pkg/qliksense/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package qliksense

import (
"bufio"
"errors"
"fmt"
"io/ioutil"
"os"
Expand Down Expand Up @@ -54,10 +53,7 @@ func (q *Qliksense) FetchK8sWithOpts(opts *FetchCommandOptions) error {
cr.SetFetchUrl(opts.GitUrl)
}
v := getVersion(opts, cr)
if v == "" {
return errors.New("Cannot find gitref/tag/branch/version to fetch")
}
if qConfig.IsRepoExistForCurrent(v) {
if v != "" && qConfig.IsRepoExistForCurrent(v) {
if opts.Overwrite || getVerionsOverwriteConfirmation(v) == "y" {
if err := qConfig.DeleteRepoForCurrent(v); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/qliksense/get_installable_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func getLatestTag(repoUrl, accessToken string) (string, error) {
v, err := semver.NewVersion(sv)
if err != nil {
// it may happen, in the repo some tags may not conform to semver
fmt.Print("Unconform tags: " + sv)
//fmt.Println("the tag is not conform to semver: " + sv)
continue
}
if maxSem == nil || maxSem.LessThan(v) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/qliksense/get_installable_versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func TestGetLatestTag(t *testing.T) {
t.Log(err)
t.Log(sv)
}
baseV, _ := semver.NewVersion("v0.0.7")
baseV, _ := semver.NewVersion("v0.0.8")
if !sv.GreaterThan(baseV) {
t.Log("Expected greater than v0.0.7, but got: " + s)
t.Log("Expected greater than v0.0.8, but got: " + s)
t.Fail()
}
}