Skip to content

Conversation

@serngawy
Copy link
Member

No description provided.

…ions to define match expression

Signed-off-by: melserngawy <[email protected]>
@openshift-ci
Copy link

openshift-ci bot commented Feb 14, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: serngawy
Once this PR has been reviewed and has the lgtm label, please assign willkutler for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

90.9% 90.9% Coverage
0.0% 0.0% Duplication

@dhaiducek
Copy link
Member

@serngawy Thanks for the PR, but providing a MatchExpression direcly is already implemented in:

We did it this way using map[string]interface{} so that the old way (providing key: value pairs) would still be supported and it wouldn't be a breaking change.

Please try what you'd like to using a new version of the generator and let us know if there are gaps.

@dhaiducek
Copy link
Member

/hold

@serngawy
Copy link
Member Author

@dhaiducek Would you give example how to do it, I'm looking to have Value NotIn expression ?

@dhaiducek
Copy link
Member

dhaiducek commented Feb 15, 2023

It looks like there's a bug with the way we're handling the deprecated placement.clusterSelectors. It works to have a PolicyGenerator manifest with:

policyDefaults:
  namespace: policies
  placement:
    clusterSelectors:
      matchExpressions:
      - key: cloud
        operator: NotIn
        values:
        - red hat

Result:

spec:
  clusterSelector:
    matchExpressions:
    - key: cloud
      operator: NotIn
      values:
      - red hat

But using clusterSelector results in an empty array:

spec:
  clusterSelector:
    matchExpressions: []

I'll work on a fix.

@serngawy serngawy closed this Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants