-
Notifications
You must be signed in to change notification settings - Fork 503
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 file signing verification error and bucket upload #2785
Conversation
Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
/priority critical-urgent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
/hold
for @cpanato and @saschagrunert to take a look if they want
@@ -120,13 +128,14 @@ func runSignBlobs(signOpts *signOptions, signBlobOpts *signBlobOptions, args []s | |||
if strings.HasSuffix(file, ".sha256") || strings.HasSuffix(file, ".sha512") || | |||
strings.HasSuffix(file, ":") || strings.HasSuffix(file, ".docker_tag") || | |||
strings.Contains(file, "SHA256SUMS") || strings.Contains(file, "SHA512SUMS") || | |||
strings.Contains(file, "README") || strings.Contains(file, "Makefile") { | |||
strings.Contains(file, "README") || strings.Contains(file, "Makefile") || | |||
strings.HasSuffix(file, certExt) || strings.HasSuffix(file, sigExt) || strings.HasSuffix(file, ".pem") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We decided to not use ".pem" at all but it should not hurt to have it part of the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this! I think we're coming close to the final version 🤞
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: puerco, saschagrunert, xmudrii The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
_, err = gcli.GSUtilOutput("cp", "-n", certFiles, signFiles, fmt.Sprintf("%s%s", object.GcsPrefix, fileBundle.destinationPathToCopy)) | ||
if err != nil { | ||
if _, err := gcli.GSUtilOutput( | ||
"cp", certFiles, signFiles, fmt.Sprintf("%s%s", object.GcsPrefix, fileBundle.destinationPathToCopy), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, that sounds good
What type of PR is this?
/kind bug
What this PR does / why we need it:
Following @xmudrii 's intuition, this PR modifies
krel sign blob
to stop synching down from the bucket any existing certificates and signatures. For some reason, this seems to avoid the verification error encountered during the v1.26.0-rc.1 release.My theory is that when resigning a file, the signatures are not written to disk if a .sig file already exists (or there is a race condition somewhere). And then the verification fails because it checks against a previous signature. I tried looking for the bug but could not find it yet. This PR avoids copying the signatures down so krel sign blob will not find them.
It also fixes another bug where copying back to the bucket would not send new signatures and certs as the
noclobber
option ofgsutil
was enabled.Which issue(s) this PR fixes:
Fixes the verification error encountered during the v1.26.0-rc.1 release.
Special notes for your reviewer:
/cc @cpanato @xmudrii @jeremyrickard @saschagrunert
Does this PR introduce a user-facing change?