Skip to content

Commit

Permalink
Fix self-upgrade (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin authored Oct 31, 2024
1 parent d96876a commit eeb86c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/version/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var (
// a path to the extracted file in the archive
// it's the responsibility of the caller to clean up the extracted file
func downloadVersion(version string, requireChecksumMatch bool) (string, error) {
releaseInfo, err := getReleaseDetails(http.DefaultClient.Timeout, "github.com", "replicatedhq", "replicated", version)
releaseInfo, err := getReleaseDetails(http.DefaultClient.Timeout, "api.github.com", "replicatedhq", "replicated", version)
if err != nil {
return "", errors.Wrap(err, "get release details")
}
Expand Down Expand Up @@ -339,9 +339,9 @@ func getReleaseDetails(timeout time.Duration, host string, owner string, repo st
uri := ""

if releaseName == "latest" {
uri = fmt.Sprintf("%s/repos/%s/%s/releases/latest", host, owner, repo)
uri = fmt.Sprintf("https://%s/repos/%s/%s/releases/latest", host, owner, repo)
} else {
uri = fmt.Sprintf("%s/repos/%s/%s/releases/tags/%s", host, owner, repo, releaseName)
uri = fmt.Sprintf("https://%s/repos/%s/%s/releases/tags/%s", host, owner, repo, releaseName)
}

req, err := http.NewRequest("GET", uri, nil)
Expand Down

0 comments on commit eeb86c5

Please sign in to comment.