fix carbide cosign repo path and perms

Signed-off-by: Adam Martin <adam.martin@rancherfederal.com>
This commit is contained in:
Adam Martin
2023-11-06 09:07:13 -05:00
parent 4d950f7b0a
commit be486df762
+6 -6
View File
@@ -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")