Return a failure instead of an error if no pinned images are found #1197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If no pinned images were found, we would throw an error for the CertifiedImages check, which isn't technically valid (because we didn't fail to run). This PR converts that into a failure instead. We would get the error in trying to query Pyxis for images with the provided digests. We're returning the error (not Pyxis), but we still want to catch it when returned and make sure it translates to a failure result and not a check execution error.
It also seems like this check had an older style "optional" configuration, which was to return true regardless of things that would cause this check to fail. I've now made this check's return value accurate to its execution, and allow for the "optional" tag enforce that it's non-blocking.
Finally, I've updated tests which asserted that the things would pass according to the older style of "optional". They would now fail, so the checks needed to be updated accordingly.
This check remains non-blocking for certification.