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

Fix OS scan when -V is not set #202

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

rphillips
Copy link
Contributor

@rphillips rphillips commented Jun 25, 2024

This PR warns when the os cannot be figured out without the -V option. The default config does not have a valid OS distribution set, since it is version specific.

@openshift-ci openshift-ci bot requested review from kolyshkin and mrunalp June 25, 2024 17:18
Copy link
Contributor

openshift-ci bot commented Jun 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rphillips

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 Jun 25, 2024
@ashwindasr
Copy link
Contributor

ashwindasr commented Jun 25, 2024

cd (certified distributions) was returning an empty list [] if -V is not set. This PR aims to fix that by failing with a new error (certified_distributions is not defined, please use -V [VERSION] on the command line). For example:

asdas@asdas-thinkpadp1gen3:~/GolandProjects/check-payload$ sudo ./check-payload scan image --spec registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-pod-rhel9@sha256:856bcc5a915f5af7dd6bfb35faa54ecb78e350c4ca5adb01d49df8915d3bb258
...
---- Failure Report
+------------------------------------+---------------------+-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| OPERATOR NAME                      | EXECUTABLE NAME     | STATUS                                                                              | IMAGE                                                                                                                                         |
+------------------------------------+---------------------+-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| openshift-enterprise-pod-container | /etc/redhat-release | certified_distributions is not defined, please use -V [VERSION] on the command line | registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-pod-rhel9@sha256:856bcc5a915f5af7dd6bfb35faa54ecb78e350c4ca5adb01d49df8915d3bb258 |
+------------------------------------+---------------------+-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+

@ashwindasr
Copy link
Contributor

also looks like verify is failing, we may need to add

"ErrCertifiedDistributionsEmpty": ErrCertifiedDistributionsEmpty,

to internal/types/error_map.go

@rphillips rphillips changed the title Fix bug Fix OS scan when -V is not set Jun 25, 2024
@kolyshkin
Copy link
Contributor

Looks like the first two commits needs to be squashed?

@rphillips rphillips force-pushed the fix-bug branch 2 times, most recently from 1ed9098 to a182ab3 Compare June 25, 2024 20:36
@rphillips
Copy link
Contributor Author

rphillips commented Jun 25, 2024

Squashed and fix upped the comments.

Copy link
Contributor

openshift-ci bot commented Jun 26, 2024

@rphillips: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ashwindasr
Copy link
Contributor

/lgtm

@rphillips rphillips added the lgtm Indicates that a PR is ready to be merged. label Jun 27, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit b036955 into openshift:main Jun 27, 2024
5 checks passed
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants