Skip to content
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

Exit with status code 1 if cosign is not configured #191

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

atanasdinov
Copy link
Contributor

@atanasdinov atanasdinov commented Feb 23, 2024

Please check below, if the PR fulfills these requirements:

  • The commit message follows the guidelines.
  • Tests for the changes have been added (for bug fixes / features).
  • Docs have been added / updated (for bug fixes / features).

What kind of change does this PR introduce?

What is the current behavior?

  • If cosign is not properly configured, Hauler will proceed the execution and fail at a later stage:
8:16AM ERR Error: open binaries/cosign-linux-amd64: file does not exist

8:16AM INF syncing [content.hauler.cattle.io/v1alpha1, Kind=Images] to store
8:16AM ERR Error (attempt 1/3): error adding image to store: fork/exec /root/.hauler/cosign: no such file or directory, output:
8:16AM ERR Error (attempt 2/3): error adding image to store: fork/exec /root/.hauler/cosign: no such file or directory, output:
8:16AM ERR Error (attempt 3/3): error adding image to store: fork/exec /root/.hauler/cosign: no such file or directory, output:
Error: operation failed after 3 attempts
Usage:
  hauler store sync [flags]

What is the new behavior (if this is a feature change)?

  • Hauler will abort execution if cosign is not found / stored at the necessary path.

Does this PR introduce a breaking change?

  • No.

@atanasdinov atanasdinov marked this pull request as ready for review February 23, 2024 08:44
@atanasdinov
Copy link
Contributor Author

Another approach would be to move this check only to the relevant subcommands e.g. info doesn't seem to require it. Let me know how you'd prefer to handle this.

@amartin120
Copy link
Contributor

@atanasdinov I'm perfectly fine with this solution, but I'm concerned about why cosign would not get configured correctly?

8:16AM ERR Error: open binaries/cosign-linux-amd64: file does not exist

I can confirm that the binary does exist within Hauler to be able to extract and put it <home>/.hauler. So I'm pretty surprised to see this.

@atanasdinov
Copy link
Contributor Author

Hi, @amartin120. This came up with our RPM packaging for Hauler. We didn't use the proper path for cosign which in turn contributed to the binary being properly compiled but not working @ runtime.

@amartin120 amartin120 merged commit d136d1b into hauler-dev:main Feb 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants