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

log validation errors separately in deployableByOLM check #847

Conversation

komish
Copy link
Contributor

@komish komish commented Dec 2, 2022

Fixes #844

Preflight executes a pre-deployment validation on the bundle to prevent failures in deployment caused by invalid bundles.

In some cases, the validation logic would return that the bundle is invalid, but this is not considered an error in validation execution so our error returned would be nil, giving the user no information as to what happened in their deployment. In truth, we hadn't even deployed the bundle yet.

This PR fixes this behavior, and now prints out all validation errors in the output in cases where our validation results == failed, but no error was thrown by the validation functions.

Signed-off-by: Jose R. Gonzalez jose@flutes.dev

Signed-off-by: Jose R. Gonzalez <jose@flutes.dev>
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 2, 2022
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 84.438% when pulling 5f37df6 on komish:log-deployable-validation-failures into c6fa6f6 on redhat-openshift-ecosystem:main.

Copy link
Contributor

@tkrishtop tkrishtop left a comment

Choose a reason for hiding this comment

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

Thank you @komish! We have now a clear error in the logs:

time="2022-12-02T20:22:55Z" level=debug msg="running check: DeployableByOLM"
time="2022-12-02T20:22:57Z" level=trace msg="reading annotations file from the bundle"
time="2022-12-02T20:22:57Z" level=debug msg="image extraction directory is /tmp/preflight-2553569998/fs"
time="2022-12-02T20:22:58Z" level=info msg="check completed: DeployableByOLM" err="the bundle cannot be deployed because deployment validation has failed: [{Name:ibm-mq.v1.3.1 Errors:[Error: Value : (ibm-mq.v1.3.1) olm.maxOpenShiftVersion csv.Annotations not specified with an OCP version lower than 4.9. This annotation is required to prevent the user from upgrading their OCP cluster before they have installed a version of their operator which is compatible with 4.9. For further information see https://docs.openshift.com/container-platform/4.8/operators/operator_sdk/osdk-working-bundle-images.html#osdk-control-compat_osdk-working-bundle-images] Warnings:[Warning: Value ibm-mq.v1.3.1: this bundle is using APIs which were deprecated and removed in v1.22. More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. Migrate the API(s) for CRD: ([\"queuemanagers.mq.ibm.com\"])]}]" result=ERROR

@openshift-ci
Copy link

openshift-ci bot commented Dec 5, 2022

@tkrishtop: changing LGTM is restricted to collaborators

In response to this:

Thank you @komish! We have now a clear error in the logs:

time="2022-12-02T20:22:55Z" level=debug msg="running check: DeployableByOLM"
time="2022-12-02T20:22:57Z" level=trace msg="reading annotations file from the bundle"
time="2022-12-02T20:22:57Z" level=debug msg="image extraction directory is /tmp/preflight-2553569998/fs"
time="2022-12-02T20:22:58Z" level=info msg="check completed: DeployableByOLM" err="the bundle cannot be deployed because deployment validation has failed: [{Name:ibm-mq.v1.3.1 Errors:[Error: Value : (ibm-mq.v1.3.1) olm.maxOpenShiftVersion csv.Annotations not specified with an OCP version lower than 4.9. This annotation is required to prevent the user from upgrading their OCP cluster before they have installed a version of their operator which is compatible with 4.9. For further information see https://docs.openshift.com/container-platform/4.8/operators/operator_sdk/osdk-working-bundle-images.html#osdk-control-compat_osdk-working-bundle-images] Warnings:[Warning: Value ibm-mq.v1.3.1: this bundle is using APIs which were deprecated and removed in v1.22. More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22. Migrate the API(s) for CRD: ([\"queuemanagers.mq.ibm.com\"])]}]" result=ERROR

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/test-infra repository.

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

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 5, 2022
@openshift-ci
Copy link

openshift-ci bot commented Dec 5, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: acornett21, bcrochet, komish, tkrishtop

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:
  • OWNERS [acornett21,bcrochet,komish]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@acornett21 acornett21 merged commit 213d62b into redhat-openshift-ecosystem:main Dec 5, 2022
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.

DeployableByOLM" err="<nil>" result=ERROR for open-access ibm-mq-operator 1.3.1
6 participants