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(
402402 return nil
403403}
404404
405- // TODO: remove this function once https://cdn.dl.k8s.io/release/release-notes-index.json
406- // is fixed.
407405func 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 )
411409 }
412410 return gcsPath
413411}
Original file line number Diff line number Diff line change @@ -383,13 +383,9 @@ func TestFixPublicReleaseNotesURL(t *testing.T) {
383383 input : "https://dl.k8s.io/release/v1.32.0-beta.0/release-notes.json" ,
384384 expected : "https://dl.k8s.io/release/v1.32.0-beta.0/release-notes.json" ,
385385 },
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" ,
393389 },
394390 } {
395391 t .Run (name , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments