From be486df76236b89aef137e6e894b45d5e77b1347 Mon Sep 17 00:00:00 2001 From: Adam Martin Date: Mon, 6 Nov 2023 09:07:13 -0500 Subject: [PATCH] fix carbide cosign repo path and perms Signed-off-by: Adam Martin --- pkg/cosign/cosign.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/cosign/cosign.go b/pkg/cosign/cosign.go index a6787122..e7e42bc4 100644 --- a/pkg/cosign/cosign.go +++ b/pkg/cosign/cosign.go @@ -146,6 +146,11 @@ func ensureCosignBinary(ctx context.Context, s *store.Layout) (string, error) { } } + // Make the binary executable. + if err := os.Chmod(filepath.Join(haulerDir, "cosign"), 0755); err != nil { + return "", fmt.Errorf("error setting executable permission: %v", err) + } + return binaryPath, nil } @@ -236,7 +241,7 @@ func downloadCosign(ctx context.Context, haulerDir string) error { l := log.FromContext(ctx) // Define the GitHub release URL and architecture-specific binary name. - releaseURL := "https://github.com/rancher-government-solutions/cosign/releases/latest/download" + releaseURL := "https://github.com/rancher-government-carbide/cosign/releases/latest/download" // Determine the architecture and add it to the binary name. arch := runtime.GOARCH @@ -269,11 +274,6 @@ func downloadCosign(ctx context.Context, haulerDir string) error { return fmt.Errorf("error saving cosign binary: %v", err) } - // Make the binary executable. - if err := os.Chmod(binaryFile.Name(), 0755); err != nil { - return fmt.Errorf("error setting executable permission: %v", err) - } - // Rename the binary to "cosign" oldBinaryPath := filepath.Join(haulerDir, binaryName) newBinaryPath := filepath.Join(haulerDir, "cosign")