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 array variables substitution #1800

Merged
merged 4 commits into from
Apr 14, 2021
Merged

Conversation

realshuting
Copy link
Member

@realshuting realshuting commented Apr 13, 2021

Signed-off-by: Shuting Zhao shutting06@gmail.com

Related issue

Fixes #1777.

ConditionOperator In and NotIn operates on a set of values. The variable substation for these types of values is not handled properly in the previous PR.

What type of PR is this

/kind bug

Proposed Changes

Proof Manifests

  1. Follow the reproduce steps described in [BUG] JMESPath expressions not being substituted in validate.message field #1777, this is the output:
Error from server: error when creating "resource.yaml": admission webhook "validate.kyverno.svc" denied the request:

resource Deployment/default/busybox was blocked due to the following policies

cm-array-example:
  validate-role-annotation: 'The animal cow is not in the allowed list of animals: ["snake","bear","cat","dog"].'
  1. If I change validate.deny.operator to In, the resource creation is allowed:
 ✗ k apply -f resource.yaml
deployment.apps/busybox created

Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • [] My PR contains new or altered behavior to Kyverno and
    • [] I have added or changed the documentation myself in an existing PR and the link is:
    • [] I have raised an issue in kyverno/website to track the doc update and the link is:
    • [] I have read the PR documentation guide and followed the process including adding proof manifests to this PR.

Further Comments

cc @kacejot

Signed-off-by: Shuting Zhao <shutting06@gmail.com>
@realshuting realshuting marked this pull request as draft April 13, 2021 21:50
@realshuting realshuting added the wip work in progress label Apr 13, 2021
kacejot and others added 3 commits April 14, 2021 16:45
Signed-off-by: Max Goncharenko <kacejot@fex.net>
Signed-off-by: Max Goncharenko <kacejot@fex.net>
@realshuting realshuting marked this pull request as ready for review April 14, 2021 19:48
@realshuting realshuting removed the wip work in progress label Apr 14, 2021
@kacejot kacejot self-requested a review April 14, 2021 19:50
@realshuting realshuting merged commit 081244a into kyverno:main Apr 14, 2021
@realshuting realshuting deleted the bug_fixes branch April 15, 2021 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] JMESPath expressions not being substituted in validate.message field
3 participants