Skip to content

Commit 681d6bc

Browse files
authored
Merge pull request #3753 from saschagrunert/link
Fix publish marker link replacement for production bucket
2 parents c868eaf + 3998f76 commit 681d6bc

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

hack/get-krel

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ KREL_OUTPUT_PATH=${KREL_OUTPUT_PATH:-bin/krel}
3333
echo "Using output path: $KREL_OUTPUT_PATH"
3434
mkdir -p "$(dirname "$KREL_OUTPUT_PATH")"
3535

36-
if [[ "$TOOL_ORG" == "$DEFAULT_TOOL_ORG" && "$TOOL_REPO" == "$DEFAULT_TOOL_REPO" && "$TOOL_REF" == "$DEFAULT_TOOL_REF" ]]; then
37-
LATEST_RELEASE=$(curl_retry https://api.github.com/repos/kubernetes/release/releases/latest | jq -r .tag_name)
38-
echo "Using krel release: $LATEST_RELEASE"
39-
40-
echo "Downloading krel from GCB bucket…"
41-
GCB_URL="https://storage.googleapis.com/k8s-artifacts-sig-release/kubernetes/release/$LATEST_RELEASE/krel-amd64-linux"
42-
curl_retry "$GCB_URL" -o "$KREL_OUTPUT_PATH"
43-
chmod +x "$KREL_OUTPUT_PATH"
44-
else
45-
echo "Building krel from sources"
46-
go build -o "$KREL_OUTPUT_PATH" ./cmd/krel
47-
fi
36+
#if [[ "$TOOL_ORG" == "$DEFAULT_TOOL_ORG" && "$TOOL_REPO" == "$DEFAULT_TOOL_REPO" && "$TOOL_REF" == "$DEFAULT_TOOL_REF" ]]; then
37+
# LATEST_RELEASE=$(curl_retry https://api.github.com/repos/kubernetes/release/releases/latest | jq -r .tag_name)
38+
# echo "Using krel release: $LATEST_RELEASE"
39+
#
40+
# echo "Downloading krel from GCB bucket…"
41+
# GCB_URL="https://storage.googleapis.com/k8s-artifacts-sig-release/kubernetes/release/$LATEST_RELEASE/krel-amd64-linux"
42+
# curl_retry "$GCB_URL" -o "$KREL_OUTPUT_PATH"
43+
# chmod +x "$KREL_OUTPUT_PATH"
44+
#else
45+
echo "Building krel from sources"
46+
go build -o "$KREL_OUTPUT_PATH" ./cmd/krel
47+
#fi
4848

4949
echo "Done, output of 'krel version':"
5050
"$KREL_OUTPUT_PATH" version

pkg/release/publish.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,12 @@ func (p *Publisher) PublishToGcs(
341341
return fmt.Errorf("get marker file destination: %w", publishFileDstErr)
342342
}
343343

344+
logrus.Infof("Using marker path: %s", markerPath)
344345
publicLink := fmt.Sprintf("%s/%s", URLPrefixForBucket(markerPath), publishFile)
345-
if strings.HasPrefix(markerPath, ProductionBucket) {
346-
publicLink = fmt.Sprintf("%s/%s", ProductionBucketURL, publishFile)
346+
if strings.HasSuffix(markerPath, ProductionBucket+"/release") {
347+
publicLink = fmt.Sprintf("%s/release/%s", ProductionBucketURL, publishFile)
347348
}
349+
logrus.Infof("Using public link: %s", publicLink)
348350

349351
uploadDir := filepath.Join(releaseStage, "upload")
350352
if err := os.MkdirAll(uploadDir, os.FileMode(0o755)); err != nil {

0 commit comments

Comments
 (0)