-
Notifications
You must be signed in to change notification settings - Fork 709
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
CMP-2859: Resolve failing Image-stream-sets-schedule #12895
base: master
Are you sure you want to change the base?
CMP-2859: Resolve failing Image-stream-sets-schedule #12895
Conversation
…ator and ClusterVersion Signed-off-by: Kaushik Talathi <[email protected]>
Hi @KaushikOP. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/jira-refresh |
@@ -32,17 +32,17 @@ references: | |||
srg: SRG-APP-000456-CTR-001125 | |||
|
|||
{{% set api_path = '/apis/image.openshift.io/v1/imagestreams' %}} | |||
{{% set jqfilter = '[.items[] | .spec.tags[]? | select(.from.kind != "ImageStreamTag") | (.importPolicy.scheduled != null and .importPolicy.scheduled != false)] | all' %}} | |||
{{% set jqfilter = '[.items[] | select( .metadata.ownerReferences? // [] | all(.kind != "ClusterVersion")) | select(.metadata.labels[]? | select("samples.operator.openshift.io/managed: true") | not) | select(.spec.tags[]?.from.kind != "ImageStreamTag" and (.importPolicy.scheduled != null or .importPolicy.scheduled != false))] | any' %}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Gather all ImageStreams -
.items[]
- Select only those not managed by
ClusterVersion
-select( .metadata.ownerReferences? // [] | all(.kind != "ClusterVersion"))
ClusterVersion
implies on upgrade that these ImageStream entries are upgraded
- From those that remain, check if it's managed by the Samples Operator, if so ignore those -
select(.metadata.labels[]? | select("samples.operator.openshift.io/managed: true") | not)
- Check the Remaining ones are not tags -
select(.spec.tags[]?.from.kind != "ImageStreamTag" and
(partial query here)
- e.g.
ImageStreamTag
latest points tov1.2.3
- The ones that remain from that check to see if scheduled is false or not set -
(.importPolicy.scheduled != null or .importPolicy.scheduled != false))] | any' %}}
If any fail the last condition it returns false for the query.
Description:
Rationale:
fixes failing rule
Fixes #CMP-2859
Review Hints: