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: use dl.k8s.io, not kubernetes-release bucket #2872

Merged
merged 3 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 11 additions & 2 deletions kinder/pkg/extract/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (

const (
ciBuildRepository = "https://storage.googleapis.com/k8s-release-dev/ci"
releaseBuildURepository = "https://storage.googleapis.com/kubernetes-release/release"
releaseBuildURepository = "https://dl.k8s.io/release"

kubeadmBinary = "kubeadm"
kubeletBinary = "kubelet"
Expand Down Expand Up @@ -509,9 +509,18 @@ var httpGetBackoff = wait.Backoff{
func httpGet(uri string) (int64, io.ReadCloser, error) {
var lastError error
var resp *http.Response

// Create a custom http.Client with redirect behavior
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
// Allow redirects
return nil
},
}

err := wait.ExponentialBackoff(httpGetBackoff, func() (bool, error) {
var err error
resp, err = http.Get(uri)
resp, err = client.Get(uri)
if err != nil {
log.Warnf("HTTP GET %s failed. Retry in few seconds", uri)
lastError = errors.Wrapf(err, "HTTP GET %s failed", uri)
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/manifests/verify_manifest_lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ func getFromURLTimeoutSize(url string, timeout int, sizeOnly bool) (string, int,
t := time.Duration(time.Duration(timeout) * time.Second)
client := http.Client{
Timeout: t,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
// Allow redirects
return nil
},
}

req, err := http.NewRequest("GET", url, nil)
Expand Down Expand Up @@ -641,7 +645,7 @@ func filterVersions(versions VersionList) (VersionList, error) {
minEstimated = version.MustParseGeneric(semVersion)
// else get the last version from the previous Major release and apply the skew.
} else {
url := fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/stable-%d.txt", minEstimated.Major()-1)
url := fmt.Sprintf("https://dl.k8s.io/release/stable-%d.txt", minEstimated.Major()-1)
rjsadow marked this conversation as resolved.
Show resolved Hide resolved
verFromURL, _, err := getFromURL(url)
if err != nil {
return versions, err
Expand Down