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

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.

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

Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change

internal/operatorsdk/operatorsdk.go Outdated Show resolved Hide resolved
Signed-off-by: Adam D. Cornett <adc@redhat.com>
@coveralls
Copy link

Coverage Status

coverage: 84.443% (-0.02%) from 84.465%
when pulling 7a4338a on acornett21:add_operator_sdk_bin_lookup
into 3a93f15 on redhat-openshift-ecosystem:main.

@dcibot
Copy link

dcibot commented Oct 21, 2024

@acornett21
Copy link
Contributor Author

/test 4.13-images

@acornett21
Copy link
Contributor Author

/test 4.17-e2e

1 similar comment
@acornett21
Copy link
Contributor Author

/test 4.17-e2e

Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@acornett21 acornett21 merged commit e64988a into redhat-openshift-ecosystem:main Oct 21, 2024
5 checks passed
@acornett21 acornett21 deleted the add_operator_sdk_bin_lookup branch October 21, 2024 21:38
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.

4 participants