Skip to content

Commit

Permalink
fix: null vs empty object comparison (#1673) (#1674)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
  • Loading branch information
gcp-cherry-pick-bot[bot] and eddycharly authored Jul 21, 2024
1 parent d0a6d47 commit e1ec629
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/hashicorp/go-getter v1.7.5
github.com/jmespath-community/go-jmespath v1.1.2-0.20240627155901-bdbb290f571e
github.com/kudobuilder/kuttl v0.18.0
github.com/kyverno/kyverno-json v0.0.3
github.com/kyverno/kyverno-json v0.0.4-0.20240721204454-61c433c46e92
github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/prometheus/common v0.47.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kudobuilder/kuttl v0.18.0 h1:WeoxTamWd8AXVj6NWH1PCaV8CEXavaPJiExbm2J7bcI=
github.com/kudobuilder/kuttl v0.18.0/go.mod h1:ZXR6RcZg9CBYvVPgd2eaGLn3o0ihSvYQOCvwaN+psaw=
github.com/kyverno/kyverno-json v0.0.3 h1:EImI/YV41dG4hDQer/W0qMZHfxqul1yiHrBEXxFrkGM=
github.com/kyverno/kyverno-json v0.0.3/go.mod h1:KUgXPXwUh0Sm/UgtHPomZAfEX8v79I3B5RZbUlzNihg=
github.com/kyverno/kyverno-json v0.0.4-0.20240721204454-61c433c46e92 h1:Q36uQjX/r7LdKv04bdaManCjbbh4v35y5wkKU8TUIiM=
github.com/kyverno/kyverno-json v0.0.4-0.20240721204454-61c433c46e92/go.mod h1:3LgZogzltja+Sx0o5CIa7d7+991v8sWXHskU0fWSOsQ=
github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c h1:lAolpR9H8BwM5lRRvgCQ8JowswyxZRH+fgtIQzHFVCk=
github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c/go.mod h1:02vxM0GNXz9+B/i6+rMfWAIwibUuAH+qFsd73IFskgQ=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
Expand Down
3 changes: 2 additions & 1 deletion testdata/e2e/examples/quick-start/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

| # | Name | Bindings | Try | Catch | Finally | Cleanup |
|:-:|---|:-:|:-:|:-:|:-:|
| 1 | [step-1](#step-step-1) | 0 | 2 | 0 | 0 | 0 |
| 1 | [step-1](#step-step-1) | 0 | 3 | 0 | 0 | 0 |

### Step: `step-1`

Expand All @@ -18,6 +18,7 @@
|:-:|---|:-:|:-:|---|
| 1 | `apply` | 0 | 0 | *No description* |
| 2 | `assert` | 0 | 0 | *No description* |
| 3 | `error` | 0 | 0 | *No description* |

---

10 changes: 10 additions & 0 deletions testdata/e2e/examples/quick-start/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ spec:
- assert:
# file is relative to the test folder
file: configmap.yaml
# this make sure a non-existent field cannot be compared to an empty object
- error:
resource:
apiVersion: v1
kind: ConfigMap
metadata:
name: chainsaw-quick-start
status:
vulnerabilitySummary:
severityCount: {}

0 comments on commit e1ec629

Please sign in to comment.