File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -402,12 +402,10 @@ func (p *Publisher) PublishToGcs(
402
402
return nil
403
403
}
404
404
405
- // TODO: remove this function once https://cdn.dl.k8s.io/release/release-notes-index.json
406
- // is fixed.
407
405
func FixPublicReleaseNotesURL (gcsPath string ) string {
408
- const prefix = "https ://storage.googleapis.com/"
409
- for strings .HasPrefix (gcsPath , prefix ) {
410
- gcsPath = strings .TrimPrefix (gcsPath , prefix )
406
+ const prefix = "gs ://" + ProductionBucket
407
+ if strings .HasPrefix (gcsPath , prefix ) {
408
+ gcsPath = ProductionBucketURL + strings .TrimPrefix (gcsPath , prefix )
411
409
}
412
410
return gcsPath
413
411
}
Original file line number Diff line number Diff line change @@ -383,13 +383,9 @@ func TestFixPublicReleaseNotesURL(t *testing.T) {
383
383
input : "https://dl.k8s.io/release/v1.32.0-beta.0/release-notes.json" ,
384
384
expected : "https://dl.k8s.io/release/v1.32.0-beta.0/release-notes.json" ,
385
385
},
386
- "should fix wrong URL with 1 prefix" : {
387
- input : "https://storage.googleapis.com/https://dl.k8s.io/release/v1.32.0-alpha.3/release-notes.json" ,
388
- expected : "https://dl.k8s.io/release/v1.32.0-alpha.3/release-notes.json" ,
389
- },
390
- "should fix wrong URL with multiple prefixes" : {
391
- input : "https://storage.googleapis.com/https://storage.googleapis.com/https://dl.k8s.io/release/v1.28.1/release-notes.json" ,
392
- expected : "https://dl.k8s.io/release/v1.28.1/release-notes.json" ,
386
+ "should fix URL referring to production bucket" : {
387
+ input : "gs://767373bbdcb8270361b96548387bf2a9ad0d48758c35/release/v1.29.11/release-notes.json" ,
388
+ expected : "https://dl.k8s.io/release/v1.29.11/release-notes.json" ,
393
389
},
394
390
} {
395
391
t .Run (name , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments