From bf797dd45509951dfe829f663bdb7f8a78eca34e Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Mon, 16 Sep 2024 14:04:26 +0200 Subject: [PATCH] Fix marker publish verification when bucket is private We need to use the private link for verification otherwise it will simply not work. This patch also adds more verbosity around the update process to enhance debugging. Related to https://github.com/kubernetes/kubernetes/issues/127350 Signed-off-by: Sascha Grunert --- pkg/release/publish.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/release/publish.go b/pkg/release/publish.go index 1ae552ebbd6..5b707303b7c 100644 --- a/pkg/release/publish.go +++ b/pkg/release/publish.go @@ -360,6 +360,7 @@ func (p *Publisher) PublishToGcs( return fmt.Errorf("write latest version file: %w", err) } + logrus.Infof("Running `gsutil cp` from %s to: %s", latestFile, publishFileDst) if err := p.client.GSUtil( "-m", "-h", "Content-Type:text/plain", @@ -374,20 +375,22 @@ func (p *Publisher) PublishToGcs( var content string if !privateBucket { // If public, validate public link + logrus.Infof("Validating uploaded version file using HTTP at %s", publicLink) response, err := p.client.GetURLResponse(publicLink) if err != nil { return fmt.Errorf("get content of %s: %w", publicLink, err) } content = response } else { - response, err := p.client.GSUtilOutput("cat", publicLink) + // Use the private location + logrus.Infof("Validating uploaded version file using `gsutil cat` at %s", publishFileDst) + response, err := p.client.GSUtilOutput("cat", publishFileDst) if err != nil { - return fmt.Errorf("get content of %s: %w", publicLink, err) + return fmt.Errorf("get content of %s: %w", publishFileDst, err) } content = response } - logrus.Infof("Validating uploaded version file at %s", publicLink) if version != content { return fmt.Errorf( "version %s it not equal response %s",