Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from KusionStack/fix-source-bug
Browse files Browse the repository at this point in the history
fix: some bug for source
  • Loading branch information
elliotxx authored May 26, 2022
2 parents 489bde2 + 6eae537 commit a184410
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions pkg/sources/cdn/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (s *releaseSource) GetVersions() []string {
versions := []string{"latest"}

// Get tags from github repo of kusion
remoteURL := "git@github.com:KusionStack/kusion"
remoteURL := "https://github.com/KusionStack/kusion"

tags, err := gitutil.GetTagListFromRemote(remoteURL, true)
if err != nil {
Expand All @@ -41,8 +41,9 @@ func (s *releaseSource) GetVersions() []string {
}

func (s *releaseSource) GetDownloadURL(ver string) (string, error) {
if ver == "latest" {
return getArchiveDownloadURL(s.GetVersions()[1])
vers := s.GetVersions()
if ver == "latest" && len(vers) > 0 {
return getArchiveDownloadURL(vers[1])
}

return getArchiveDownloadURL(ver)
Expand Down
7 changes: 4 additions & 3 deletions pkg/sources/github/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (s *releaseSource) GetVersions() []string {
versions := []string{"latest"}

// Get tags from github repo of kusion
remoteURL := "git@github.com:KusionStack/kusion"
remoteURL := "https://github.com/KusionStack/kusion"

tags, err := gitutil.GetTagListFromRemote(remoteURL, true)
if err != nil {
Expand All @@ -41,8 +41,9 @@ func (s *releaseSource) GetVersions() []string {
}

func (s *releaseSource) GetDownloadURL(ver string) (string, error) {
if ver == "latest" {
return getArchiveDownloadURL(s.GetVersions()[1])
vers := s.GetVersions()
if ver == "latest" && len(vers) > 0 {
return getArchiveDownloadURL(vers[1])
}

return getArchiveDownloadURL(ver)
Expand Down

0 comments on commit a184410

Please sign in to comment.