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

add exec.LookPath to check operator-sdk is in $PATH #1209

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

acornett21
Copy link
Contributor

Motivation

The ux when a user does not have operator-sdk in their path leads to a confusing error that is hard to track down.

Current Error Message:

time="2024-10-02T15:57:04+02:00" level=info msg="check completed" check=ScorecardBasicSpecCheck err="failed to run operator-sdk scorecard: unexpected end of JSON input" result=ERROR

This error is not clear at all what is going on, but we do not have direct control of this once we shell out to operator-sdk

Changes

Add an explicit check to make sure that operator-sdk binary is in the users PATH. This provides an error message that is more clearer.

New Error Message:

time="2024-10-16T13:05:53-07:00" level=info msg="check completed" check=ScorecardBasicSpecCheck err="exec: \"operator-sdk\": executable file not found in $PATH" result=ERROR

Note

Since this is in the Scorecard method, it does not matter which check Basic or OlmSuite gets called, this error will appear.

Signed-off-by: Adam D. Cornett <adc@redhat.com>
Copy link

openshift-ci bot commented Oct 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: acornett21

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 16, 2024
@dcibot
Copy link

dcibot commented Oct 17, 2024

@dcibot
Copy link

dcibot commented Oct 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants