Skip to content

Commit

Permalink
Merge pull request #2782 from cpanato/fix-copy
Browse files Browse the repository at this point in the history
when downloading copy o local using the same directory structure
  • Loading branch information
k8s-ci-robot authored Nov 29, 2022
2 parents 3c34480 + 814f635 commit c7241e1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/krel/cmd/sign_blobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,17 @@ func runSignBlobs(signOpts *signOptions, signBlobOpts *signBlobOptions, args []s
strings.Contains(file, "README") || strings.Contains(file, "Makefile") {
continue
}
temp := strings.TrimPrefix(file, object.GcsPrefix)
err = gcsClient.CopyToLocal(file, tempDir)
destinationPath := strings.TrimPrefix(file, object.GcsPrefix)
localPath := filepath.Join(tempDir, filepath.Dir(destinationPath), filepath.Base(destinationPath))
err = gcsClient.CopyToLocal(file, localPath)
if err != nil {
return fmt.Errorf("copying file to sign: %w", err)
}

bundle = append(bundle, signingBundle{
destinationPathToCopy: filepath.Dir(temp),
fileToSign: filepath.Base(temp),
fileLocalLocation: fmt.Sprintf("%s/%s", tempDir, filepath.Base(temp)),
destinationPathToCopy: filepath.Dir(destinationPath),
fileToSign: filepath.Base(destinationPath),
fileLocalLocation: localPath,
})
}
} else {
Expand Down

0 comments on commit c7241e1

Please sign in to comment.