Compare commits

..

168 Commits

Author SHA1 Message Date
gcp-cherry-pick-bot[bot] 6d5444a027
chore: update release notes (#1578) (#1579)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-24 07:56:07 +00:00
gcp-cherry-pick-bot[bot] 216cd86837
feat: add test scenarios support (#1576) (#1577)
* feat: add test scenarios support



* fix



* scenario id



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-23 21:02:38 +00:00
gcp-cherry-pick-bot[bot] 82b2504e93
chore(deps): bump ko-build/setup-ko from 0.6 to 0.7 (#1572) (#1575)
Bumps [ko-build/setup-ko](https://github.com/ko-build/setup-ko) from 0.6 to 0.7.
- [Release notes](https://github.com/ko-build/setup-ko/releases)
- [Commits](ace48d7935...3aebd0597d)

---
updated-dependencies:
- dependency-name: ko-build/setup-ko
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 20:05:11 +00:00
gcp-cherry-pick-bot[bot] 813e10e9fd
chore(deps): bump aquasecurity/trivy-action from 0.22.0 to 0.23.0 (#1573) (#1574)
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.22.0 to 0.23.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](595be6a0f6...7c2007bcb5)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 15:18:50 +00:00
gcp-cherry-pick-bot[bot] 0805301f6a
refactor: v1alpha2 api (#1567) (#1570)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-17 11:06:42 +00:00
gcp-cherry-pick-bot[bot] 99373ca197
chore(deps): bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#1568) (#1569)
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 10:08:28 +00:00
gcp-cherry-pick-bot[bot] 4b42a99474
chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions (#1565) (#1566)
Bumps [zgosalvez/github-actions-ensure-sha-pinned-actions](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions) from 3.0.7 to 3.0.9.
- [Release notes](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions/releases)
- [Commits](76d1d8e0b0...74606c3045)

---
updated-dependencies:
- dependency-name: zgosalvez/github-actions-ensure-sha-pinned-actions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 09:59:15 +00:00
gcp-cherry-pick-bot[bot] 362749b645
chore(deps): bump github/codeql-action from 3.25.9 to 3.25.10 (#1563) (#1564)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.9 to 3.25.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](530d4feaa9...23acc5c183)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 14:51:21 +02:00
gcp-cherry-pick-bot[bot] f6d484ed83
chore(deps): bump actions/checkout from 4.1.6 to 4.1.7 (#1551) (#1562)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 07:05:15 +00:00
gcp-cherry-pick-bot[bot] 60545e5b54
chore(deps): bump codecov/codecov-action from 4.4.1 to 4.5.0 (#1552) (#1561)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 4.5.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](125fc84a9a...e28ff129e5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 12:24:26 +00:00
gcp-cherry-pick-bot[bot] 55d5bb8ace
chore(deps): bump github/codeql-action from 3.25.8 to 3.25.9 (#1553) (#1560)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.8 to 3.25.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](2e230e8fe0...530d4feaa9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 10:34:13 +00:00
gcp-cherry-pick-bot[bot] 2c097c4087
chore(deps): bump k8s.io/client-go from 0.30.1 to 0.30.2 (#1555) (#1559)
Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.30.1 to 0.30.2.
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.30.1...v0.30.2)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 10:25:44 +00:00
gcp-cherry-pick-bot[bot] 05ba99f6e6
chore(deps): bump k8s.io/apimachinery from 0.30.1 to 0.30.2 (#1556) (#1558)
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.30.1 to 0.30.2.
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.30.1...v0.30.2)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 10:16:52 +00:00
gcp-cherry-pick-bot[bot] ee6520bf95
feat: more test v1alpha2 changes (#1533) (#1550)
* feat: more test v1alpha2 changes



* action types



* operation



* catch



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-13 12:06:40 +02:00
gcp-cherry-pick-bot[bot] 0fdf5cddd9
refactor: action api structs (#1548) (#1549)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-12 14:48:23 +00:00
gcp-cherry-pick-bot[bot] 423692c22d
refactor: action api structs (#1546) (#1547)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-12 09:33:32 +00:00
gcp-cherry-pick-bot[bot] 013ec08958
fix: use python virtual env (#1544) (#1545)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-10 19:51:16 +00:00
gcp-cherry-pick-bot[bot] ee8e1f1825
chore(deps): bump github.com/kudobuilder/kuttl from 0.16.0 to 0.17.0 (#1542) (#1543)
Bumps [github.com/kudobuilder/kuttl](https://github.com/kudobuilder/kuttl) from 0.16.0 to 0.17.0.
- [Release notes](https://github.com/kudobuilder/kuttl/releases)
- [Changelog](https://github.com/kudobuilder/kuttl/blob/main/RELEASE.md)
- [Commits](https://github.com/kudobuilder/kuttl/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: github.com/kudobuilder/kuttl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 10:25:31 +00:00
gcp-cherry-pick-bot[bot] 7a241ad029
chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions (#1540) (#1541)
Bumps [zgosalvez/github-actions-ensure-sha-pinned-actions](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions) from 3.0.6 to 3.0.7.
- [Release notes](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions/releases)
- [Commits](2f2ebc6d91...76d1d8e0b0)

---
updated-dependencies:
- dependency-name: zgosalvez/github-actions-ensure-sha-pinned-actions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:31:11 +00:00
gcp-cherry-pick-bot[bot] 4a82481aab
chore(deps): bump aquasecurity/trivy-action from 0.21.0 to 0.22.0 (#1534) (#1536)
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](fd25fed697...595be6a0f6)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-07 11:57:57 +00:00
gcp-cherry-pick-bot[bot] b305f4f348
chore(deps): bump goreleaser/goreleaser-action from 5.1.0 to 6.0.0 (#1518) (#1532)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 5.1.0 to 6.0.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](5742e2a039...286f3b13b1)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-06 20:33:48 +00:00
gcp-cherry-pick-bot[bot] f1e9450194
fix: default values in api (#1530) (#1531)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-06 20:03:59 +00:00
gcp-cherry-pick-bot[bot] aed1f4307b
chore: fix release notes (#1527) (#1529)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-06 13:31:03 +00:00
gcp-cherry-pick-bot[bot] 56f7b12c31
release: v0.2.4 (#1523) (#1524)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-06 14:18:53 +02:00
dependabot[bot] 558ab42ade chore(deps): bump github/codeql-action from 3.25.7 to 3.25.8 (#1517)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.7 to 3.25.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f079b84933...2e230e8fe0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-06 13:57:47 +02:00
gcp-cherry-pick-bot[bot] 60623e67fc
chore: update release notes (#1521) (#1522)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-06 11:51:34 +00:00
gcp-cherry-pick-bot[bot] 093c9e37b0
chore(deps): bump sigs.k8s.io/controller-runtime from 0.18.3 to 0.18.4 (#1519) (#1520)
Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.18.3 to 0.18.4.
- [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.18.3...v0.18.4)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/controller-runtime
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-06 11:27:22 +00:00
gcp-cherry-pick-bot[bot] 18d99b5e9f
feat: introduce test v1alpha2 (#1493) (#1516)
* feat: introduce test v1alpha2



* fix merge



* test options



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-04 10:00:08 +02:00
gcp-cherry-pick-bot[bot] fa19a76cf7
refactor: merge catch and finally structs (#1514) (#1515)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-04 01:36:50 +02:00
gcp-cherry-pick-bot[bot] 9b05a247d5
feat: add missing operations (#1510) (#1513)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-04 00:30:04 +02:00
gcp-cherry-pick-bot[bot] a27c25512a
fix: patch validation incorrect field (#1511) (#1512)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-03 23:59:15 +02:00
gcp-cherry-pick-bot[bot] a99022371b
fix: templating options defaulting in v1alpha2 (#1508) (#1509)
* fix: templating options defaulting in v1alpha2



* fix tests



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-03 17:49:42 +00:00
gcp-cherry-pick-bot[bot] e337ce6c77
chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions (#1506) (#1507)
Bumps [zgosalvez/github-actions-ensure-sha-pinned-actions](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions) from 3.0.5 to 3.0.6.
- [Release notes](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions/releases)
- [Commits](40e45e738b...2f2ebc6d91)

---
updated-dependencies:
- dependency-name: zgosalvez/github-actions-ensure-sha-pinned-actions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 13:54:53 +00:00
gcp-cherry-pick-bot[bot] a215bb2ef4
chore: bump a couple of deps (#1503) (#1504)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-01 23:56:38 +00:00
gcp-cherry-pick-bot[bot] 6f81e73441
chore: bump kyverno-json (#1501) (#1502)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-06-01 09:07:04 +00:00
gcp-cherry-pick-bot[bot] be87640044
chore: remove old config file (#1498) (#1499)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-31 02:10:10 +02:00
gcp-cherry-pick-bot[bot] 05aefe91df
feat: add file support to delete operation (#1496) (#1497)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-30 22:30:55 +00:00
gcp-cherry-pick-bot[bot] a301cb7c9c
refactor: delete operation reference (#1494) (#1495)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-30 13:20:48 +00:00
gcp-cherry-pick-bot[bot] dc507c2315
chore: bump kubectl-validate (#1490) (#1491)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-30 10:30:41 +00:00
gcp-cherry-pick-bot[bot] bac32f71fd
fix: yaml anchors processing (#1487) (#1489)
* fix: yaml anchors processing



* feature flag



* fix test



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-30 09:51:00 +00:00
gcp-cherry-pick-bot[bot] bcbff46a1e
fix: remove deprecated direct resource support (#1479) (#1486)
* fix: remove deprecated direct resource support



* fix



* rm dead code



* fix tests



* fix tests



* clean



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-29 21:18:40 +00:00
gcp-cherry-pick-bot[bot] 94d92efe85
feat: add test metadata binding (#1484) (#1485)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-29 14:56:38 +00:00
gcp-cherry-pick-bot[bot] ea600f38a7
refactor: introduce api clusters type (#1482) (#1483)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-29 11:39:52 +00:00
gcp-cherry-pick-bot[bot] fd4609ddc6
docs: remove code markers on titles in api reference documentation (#1480) (#1481)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-29 08:44:17 +00:00
gcp-cherry-pick-bot[bot] b70ab1e301
release: v0.2.3 (#1473) (#1476)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-29 07:02:49 +00:00
gcp-cherry-pick-bot[bot] 27971133cb
fix: deletion propagation flag (#1474) (#1475)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-28 23:50:02 +00:00
gcp-cherry-pick-bot[bot] 26589f3206
chore: proof read docs (#1470) (#1472)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-28 21:36:57 +00:00
gcp-cherry-pick-bot[bot] de919e9612
chore: update v0.2.3 release notes (#1468) (#1469)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-27 19:49:17 +00:00
gcp-cherry-pick-bot[bot] 07eb449842
chore: add positive/negative testing to home (#1466) (#1467)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-27 18:57:11 +00:00
gcp-cherry-pick-bot[bot] cf2c77e95c
chore: update home (#1463) (#1465)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-27 17:38:00 +00:00
gcp-cherry-pick-bot[bot] 20e426e34f
refactor: introduce operation base (#1462) (#1464)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-27 16:14:11 +00:00
gcp-cherry-pick-bot[bot] 9ba295143d
docs: restructure test docs (#1460) (#1461)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-27 15:46:31 +00:00
gcp-cherry-pick-bot[bot] 64bd2fe1b7
docs: restructure test docs (#1458) (#1459)
* docs: restructure test docs



* docs: restructure test docs



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-27 13:10:24 +00:00
gcp-cherry-pick-bot[bot] 0514dc2d38
docs: restructure test docs (#1454) (#1457)
* docs: restructure test docs



* save



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-27 11:07:15 +00:00
gcp-cherry-pick-bot[bot] 693c0d9c16
fix: linter error (#1455) (#1456)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-27 12:58:42 +02:00
gcp-cherry-pick-bot[bot] 5e45e98ab0
docs: restructure test docs (#1450) (#1451)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 23:57:43 +00:00
gcp-cherry-pick-bot[bot] a5a8d5c53e
docs: restructure test docs (#1448) (#1449)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 23:30:43 +02:00
gcp-cherry-pick-bot[bot] e0abec8381
docs: restructure test docs (#1446) (#1447)
* chore: reorganise reference docs storage (#1443)



* docs: restructure test docs



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 17:23:26 +00:00
gcp-cherry-pick-bot[bot] 46d6e5e105
chore: reorganise reference docs storage (#1443) (#1444)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 15:09:46 +00:00
gcp-cherry-pick-bot[bot] bd0bba7ef5
docs: restructure test docs (#1441) (#1442)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 14:39:26 +00:00
gcp-cherry-pick-bot[bot] 31c043659a
fix: social cards (#1439) (#1440)
* chore: reference docs nits



* fix: social cards



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 11:05:34 +00:00
gcp-cherry-pick-bot[bot] 8fa8726974
chore: enable social cards (#1433) (#1438)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 10:57:32 +00:00
gcp-cherry-pick-bot[bot] b53fbef960
fix: docs typos (#1436) (#1437)
* chore: reference docs nits



* fix: docs typos



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 10:35:44 +00:00
gcp-cherry-pick-bot[bot] 79749433c4
chore: reference docs nits (#1434) (#1435)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 10:20:19 +00:00
gcp-cherry-pick-bot[bot] 082e83eb41
chore(deps): bump aquasecurity/trivy-action from 0.20.0 to 0.21.0 (#1431) (#1432)
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](b2933f565d...fd25fed697)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 09:49:46 +00:00
gcp-cherry-pick-bot[bot] a26c3f3cea
feat: update default config to v1alpha2 (part 3) (#1429) (#1430)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 09:41:09 +00:00
gcp-cherry-pick-bot[bot] f17e00fd68
feat: update default config to v1alpha2 (part 2) (#1422) (#1427)
* feat: update default config to v1alpha2 (part 2)



* updates



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 09:26:19 +00:00
gcp-cherry-pick-bot[bot] 231ea9a79c
refactor: v1alpha2 configuration api (#1425) (#1426)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 07:10:59 +00:00
gcp-cherry-pick-bot[bot] fe176c0000
feat: add arrows to navigate home sections (#1423) (#1424)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-23 00:30:49 +00:00
gcp-cherry-pick-bot[bot] f5eec08361
docs: update config to v1alpha2 (#1418) (#1421)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 22:47:04 +00:00
gcp-cherry-pick-bot[bot] 13a0cf9082
feat: update default config to v1alpha2 (#1419) (#1420)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 20:55:46 +00:00
gcp-cherry-pick-bot[bot] 08787c49df
docs: improve docs pages (#1415) (#1416)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 15:46:34 +00:00
gcp-cherry-pick-bot[bot] 6a0605684f
docs: add bindings reference docs (#1413) (#1414)
* docs: rework configuration docs



* docs: add bindings reference docs



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 14:52:26 +00:00
gcp-cherry-pick-bot[bot] 0c62ea7eb1
feat: allow the configuration of the deletion propagation policy (#1325) (#1412)
* feat: allow the configuration of the deletion propagation policy



* chore: fix unit tests



* chore: fix codegen



* chore: fix codegen



---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: Mariam Fahmy <mariamfahmy66@gmail.com>
2024-05-22 14:06:22 +00:00
gcp-cherry-pick-bot[bot] 68c3faaaa7
docs: rework configuration docs (#1410) (#1411)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 15:49:59 +02:00
gcp-cherry-pick-bot[bot] 7431f1c37b
--- (#1408) (#1409)
updated-dependencies:
- dependency-name: github.com/go-logr/logr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 11:09:25 +00:00
gcp-cherry-pick-bot[bot] ce155eeae5
docs: multi cluster guide (#1406) (#1407)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 09:07:13 +00:00
gcp-cherry-pick-bot[bot] 42ee5aaa77
docs: remove examples (#1404) (#1405)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 08:36:32 +00:00
gcp-cherry-pick-bot[bot] 8bd9b98394
docs: improve assertion guide (#1402) (#1403)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 07:57:23 +00:00
gcp-cherry-pick-bot[bot] afcb015385
docs: fixed broken link in README (#1400) (#1401)
Signed-off-by: free6om <free6om.c@gmail.com>
Co-authored-by: free6om <free6om.c@gmail.com>
2024-05-22 09:36:17 +02:00
gcp-cherry-pick-bot[bot] bcfd85a2f0
docs: label selectors guide (#1398) (#1399)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-22 00:01:42 +00:00
gcp-cherry-pick-bot[bot] a5732f01bc
docs: negative testing guide (#1396) (#1397)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 23:32:13 +00:00
gcp-cherry-pick-bot[bot] 44b22d0e36
fix: css min-height (#1394) (#1395)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 23:15:54 +00:00
gcp-cherry-pick-bot[bot] 6773dc8cd3
docs: add more advanced guides (#1392) (#1393)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 22:06:19 +00:00
gcp-cherry-pick-bot[bot] 8bed4698ac
docs: add non resource assertion guide (#1389) (#1391)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 21:20:01 +00:00
gcp-cherry-pick-bot[bot] 1c5e38e88d
docs: advanced check kube version docs (#1386) (#1390)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 21:05:59 +00:00
gcp-cherry-pick-bot[bot] 180ae170ee
feat: add cleanup support to tests catalog (#1384) (#1388)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 20:51:52 +00:00
gcp-cherry-pick-bot[bot] eefb4482df
feat: add cleanup validation logic (#1385) (#1387)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 20:35:29 +00:00
gcp-cherry-pick-bot[bot] 384132c04d
docs: add reference docs tab (#1375) (#1383)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 19:41:54 +00:00
gcp-cherry-pick-bot[bot] 63c0b6a5d7
docs: move configuration in its own tab (#1374) (#1382)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 19:28:02 +00:00
gcp-cherry-pick-bot[bot] 78b71a0eef
docs: crds use case docs (#1370) (#1380)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 19:10:54 +00:00
gcp-cherry-pick-bot[bot] e80ebb20a4
release: v0.2.2 (#1376) (#1377)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 19:25:14 +02:00
gcp-cherry-pick-bot[bot] feb61e03fa
docs: add cleanup docs (#1368) (#1371)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 18:03:36 +02:00
gcp-cherry-pick-bot[bot] 38dc40a360
chore: update release notes (#1369) (#1372)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 15:52:29 +00:00
gcp-cherry-pick-bot[bot] 1d4741a01c
feat: add cleanup handler (#1364) (#1367)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 13:43:11 +00:00
gcp-cherry-pick-bot[bot] 35e0abe471
fix: catch/finally execution order (#1351) (#1362)
* fix: catch/finally execution order



* fix tests



* skip bad test



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 13:34:02 +02:00
gcp-cherry-pick-bot[bot] 56bf5af759
docs: add placeholder for advanced use cases (#1361) (#1363)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 11:27:18 +00:00
gcp-cherry-pick-bot[bot] fa6ba2e721
docs: operation outputs page (#1358) (#1360)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 10:45:52 +00:00
gcp-cherry-pick-bot[bot] 99f37cadd2
--- (#1349) (#1359)
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 10:37:18 +00:00
gcp-cherry-pick-bot[bot] 3679a1dd43
docs: resource templating docs (#1354) (#1357)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-21 10:20:23 +00:00
gcp-cherry-pick-bot[bot] 02ec44faf9
--- (#1348) (#1356)
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 10:06:08 +00:00
gcp-cherry-pick-bot[bot] f3fd620429
--- (#1350) (#1353)
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 09:52:17 +00:00
gcp-cherry-pick-bot[bot] 78a1d00f05
chore(deps): Bump github/codeql-action from 2.13.4 to 3.25.5 (#1342) (#1344)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.13.4 to 3.25.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cdcdbb5797...b7cec75265)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 22:24:39 +00:00
gcp-cherry-pick-bot[bot] f27c7756de
fix: linter issues (#1345) (#1346)
* fix: linter issues



* fix: linter issues



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-20 21:42:24 +00:00
gcp-cherry-pick-bot[bot] 955eabef77
chore: improve try catch finally page (#1338) (#1339)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-18 00:11:35 +00:00
gcp-cherry-pick-bot[bot] 9fabf9c33f
chore: improve bindings page (#1336) (#1337)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-18 00:02:14 +00:00
gcp-cherry-pick-bot[bot] 4fe68214e4
chore: improve timeouts quick start (#1334) (#1335)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 21:35:00 +00:00
gcp-cherry-pick-bot[bot] f91cb71a43
chore: improve next steps page (#1332) (#1333)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 20:21:41 +00:00
gcp-cherry-pick-bot[bot] 0b235f4851
chore: restructure the getting started guide (#1330) (#1331)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 18:30:38 +00:00
gcp-cherry-pick-bot[bot] 77ae277e86
chore: improve assertions quick start (#1326) (#1329)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 17:49:57 +00:00
gcp-cherry-pick-bot[bot] 50e5a45b85
chore: add resource templating into (#1323) (#1324)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 19:42:33 +02:00
gcp-cherry-pick-bot[bot] 90176eb538
chore: rework introduction (#1321) (#1322)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 14:48:55 +00:00
gcp-cherry-pick-bot[bot] da759b6b2b
chore: add missing adopters to the home page (#1319) (#1320)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 10:17:21 +00:00
gcp-cherry-pick-bot[bot] 7771f24a27
chore(deps): Bump actions/checkout from 4.1.5 to 4.1.6 (#1316) (#1318)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.5 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](44c2b7a8a4...a5ac7e51b4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 09:41:53 +00:00
gcp-cherry-pick-bot[bot] 649f593f0a
chore: improve install page (#1315) (#1317)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 09:32:59 +00:00
gcp-cherry-pick-bot[bot] 119d34696b
chore: move community page to its own tab (#1312) (#1313)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 08:29:12 +00:00
gcp-cherry-pick-bot[bot] 9585468a14
chore: remove blog (#1310) (#1311)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-17 07:26:22 +00:00
gcp-cherry-pick-bot[bot] e968e662ba
fix: improve home (#1303) (#1305)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-16 16:39:50 +00:00
gcp-cherry-pick-bot[bot] ed0bdae4bc
fix: mike (#1302) (#1304)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-16 16:32:18 +00:00
gcp-cherry-pick-bot[bot] 0bae442d66
fix: improve home page (#1300) (#1301)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-16 18:11:21 +02:00
gcp-cherry-pick-bot[bot] 7613418576
fix: disable instant nav (#1298) (#1299)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-16 14:09:54 +00:00
gcp-cherry-pick-bot[bot] 010db9c13b
feat: improve home page (#1292) (#1297)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-16 12:07:55 +00:00
gcp-cherry-pick-bot[bot] 29ebd16a57
fix: Use config file namespaceTemplate if set (#1279) (#1293)
Signed-off-by: Mike Bryant <mike@mikebryant.me.uk>
Co-authored-by: Mike Bryant <mike@mikebryant.me.uk>
2024-05-16 13:48:13 +02:00
gcp-cherry-pick-bot[bot] f9065d761f
release: v0.2.1 (#1287) (#1289)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-15 22:37:14 +00:00
gcp-cherry-pick-bot[bot] 6db661cf41
chore: add v0.2.1 in bug reports template (#1285) (#1288)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-15 22:29:10 +00:00
gcp-cherry-pick-bot[bot] 218e978bd4
release: v0.2.1 (#1284) (#1286)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-15 22:21:01 +00:00
gcp-cherry-pick-bot[bot] 23a5913303
chore: update docs (#1282) (#1283)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-15 19:54:40 +00:00
gcp-cherry-pick-bot[bot] efb3eb4ec0
chore: update release notes (#1280) (#1281)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-15 19:10:53 +00:00
gcp-cherry-pick-bot[bot] 5449554481
fix: make sure we resolve cluster only once (#1276) (#1277)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-15 08:21:51 +00:00
gcp-cherry-pick-bot[bot] 4915642163
chore(deps): Bump github.com/fatih/color from 1.16.0 to 1.17.0 (#1272) (#1274)
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/fatih/color
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 21:34:11 +00:00
gcp-cherry-pick-bot[bot] 39adbf6274
chore(deps): Bump codecov/codecov-action from 4.3.1 to 4.4.0 (#1271) (#1273)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.3.1 to 4.4.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](5ecb98a3c6...6d798873df)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 21:13:26 +00:00
gcp-cherry-pick-bot[bot] c8fad0663b
feat: add direct cluster config support (#1207) (#1270)
* feat: add direct cluster config support



* refactor: clusters bank



* add note about cleanup changes



* cleanup



* tests



* tests



* tests



* tests



* tests



* dummy



* tests



* tests



---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-13 22:30:36 +00:00
gcp-cherry-pick-bot[bot] 57d9440577
feat: force background propagation deletion (#1267) (#1269)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-13 14:45:26 +00:00
gcp-cherry-pick-bot[bot] 6be49603ec
chore(deps): Bump goreleaser/goreleaser-action from 5.0.0 to 5.1.0 (#1266) (#1268)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](7ec5c2b0c6...5742e2a039)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 12:08:45 +00:00
gcp-cherry-pick-bot[bot] 534afdaf90
feat: enable templating by default (#1264) (#1265)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-12 21:52:29 +02:00
gcp-cherry-pick-bot[bot] b70a6ce0c1
chore(deps): Bump aquasecurity/trivy-action from 0.19.0 to 0.20.0 (#1258) (#1261)
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.19.0 to 0.20.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](d710430a67...b2933f565d)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 09:57:33 +00:00
gcp-cherry-pick-bot[bot] fd0339b146
chore(deps): Bump golangci/golangci-lint-action from 5.3.0 to 6.0.1 (#1257) (#1260)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 5.3.0 to 6.0.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](38e1018663...a4f60bb28d)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 09:49:15 +00:00
gcp-cherry-pick-bot[bot] 584ecf7f7b
chore(deps): Bump actions/checkout from 4.1.4 to 4.1.5 (#1254) (#1259)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](0ad4b8fada...44c2b7a8a4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 09:40:16 +00:00
gcp-cherry-pick-bot[bot] 6b8c3bd757
chore(deps): Bump zgosalvez/github-actions-ensure-sha-pinned-actions (#1249) (#1252)
Bumps [zgosalvez/github-actions-ensure-sha-pinned-actions](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions) from 3.0.4 to 3.0.5.
- [Release notes](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions/releases)
- [Commits](19ebcb0bab...40e45e738b)

---
updated-dependencies:
- dependency-name: zgosalvez/github-actions-ensure-sha-pinned-actions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-06 12:24:24 +00:00
gcp-cherry-pick-bot[bot] 661554179e
chore(deps): Bump golangci/golangci-lint-action from 5.1.0 to 5.3.0 (#1250) (#1251)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 5.1.0 to 5.3.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](9d1e0624a7...38e1018663)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 14:15:23 +02:00
gcp-cherry-pick-bot[bot] 6bb2b2e6e1
feat: add pause on failure option (#1247) (#1248)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-05 10:43:00 +00:00
gcp-cherry-pick-bot[bot] c7a4964904
chore(deps): Bump actions/setup-go from 5.0.0 to 5.0.1 (#1245) (#1246)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](0c52d547c9...cdcb360436)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-03 09:35:52 +00:00
gcp-cherry-pick-bot[bot] 596041226a
chore(deps): Bump golangci/golangci-lint-action from 5.0.0 to 5.1.0 (#1230) (#1243)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](82d40c283a...9d1e0624a7)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 14:59:31 +00:00
gcp-cherry-pick-bot[bot] 0734d549f5
chore(deps): Bump codecov/codecov-action from 4.3.0 to 4.3.1 (#1233) (#1241)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](84508663e9...5ecb98a3c6)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 14:24:47 +00:00
gcp-cherry-pick-bot[bot] 09792c70de
chore(deps): Bump anchore/sbom-action from 0.15.10 to 0.15.11 (#1229) (#1240)
Bumps [anchore/sbom-action](https://github.com/anchore/sbom-action) from 0.15.10 to 0.15.11.
- [Release notes](https://github.com/anchore/sbom-action/releases)
- [Commits](ab5d7b5f48...7ccf588e3c)

---
updated-dependencies:
- dependency-name: anchore/sbom-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 12:44:59 +00:00
gcp-cherry-pick-bot[bot] 967bf17146
chore: update issue templates (#1238) (#1239)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-02 12:28:57 +00:00
Charles-Edouard Brétéché 8fb7732137
release: v0.2.0 (#1234)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-05-02 13:30:35 +02:00
gcp-cherry-pick-bot[bot] f073726899
chore: use upstream kubectl-validate (#1226) (#1227)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-27 11:48:00 +00:00
gcp-cherry-pick-bot[bot] 6c60e5a3d9
chore(deps): Bump slsa-framework/slsa-github-generator (#1196) (#1225)
Bumps [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator) from 1.10.0 to 2.0.0.
- [Release notes](https://github.com/slsa-framework/slsa-github-generator/releases)
- [Changelog](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slsa-framework/slsa-github-generator/compare/v1.10.0...v2.0.0)

---
updated-dependencies:
- dependency-name: slsa-framework/slsa-github-generator
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-25 18:40:10 +00:00
gcp-cherry-pick-bot[bot] 3c6932648d
chore: update release notes (#1223) (#1224)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-25 17:51:34 +00:00
Charles-Edouard Brétéché 7ff7ea7488
cherry-pick: release 0.2 (#1222)
* chore(deps): Bump amannn/action-semantic-pull-request (#1204)

Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 5.4.0 to 5.5.0.
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md)
- [Commits](e9fabac35e...c24d6dd07c)

---
updated-dependencies:
- dependency-name: amannn/action-semantic-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* chore(deps): Bump amannn/action-semantic-pull-request (#1211)

Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 5.5.0 to 5.5.2.
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md)
- [Commits](c24d6dd07c...cfb60706e1)

---
updated-dependencies:
- dependency-name: amannn/action-semantic-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 19:31:48 +02:00
gcp-cherry-pick-bot[bot] ed0cc751fb
chore: bump a couple of deps (#1220) (#1221)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-25 16:04:23 +00:00
gcp-cherry-pick-bot[bot] 363b246e91
chore(deps): Bump golangci/golangci-lint-action from 4.0.0 to 5.0.0 (#1210) (#1219)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 4.0.0 to 5.0.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](3cfe3a4abb...82d40c283a)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 17:38:21 +02:00
gcp-cherry-pick-bot[bot] 48b069b499
chore(deps): Bump actions/download-artifact from 4.1.6 to 4.1.7 (#1213) (#1218)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](9c19ed7fe5...65a9edc588)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 15:19:04 +00:00
gcp-cherry-pick-bot[bot] 0ae5dd936f
chore(deps): Bump actions/checkout from 4.1.3 to 4.1.4 (#1212) (#1217)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1d96c772d1...0ad4b8fada)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 15:11:40 +00:00
gcp-cherry-pick-bot[bot] dcc6d45e50
docs: add Linode COSI to ADOPTERS.md (#1215) (#1216)
Signed-off-by: Richard Kovacs <kovacsricsi@gmail.com>
Co-authored-by: Richard Kovacs <kovacsricsi@gmail.com>
2024-04-25 14:54:25 +00:00
gcp-cherry-pick-bot[bot] 97a925baf9
docs: document command args quote behavior (#1208) (#1209)
Signed-off-by: Richard Kovacs <kovacsricsi@gmail.com>
Co-authored-by: Richard Kovacs <kovacsricsi@gmail.com>
2024-04-24 23:43:04 +00:00
gcp-cherry-pick-bot[bot] 037f62bdd8
fix: windows issue (#1201) (#1202)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-23 18:51:28 +00:00
gcp-cherry-pick-bot[bot] a6082dbe7d
chore(deps): Bump github.com/kudobuilder/kuttl from 0.15.0 to 0.16.0 (#1193) (#1200)
Bumps [github.com/kudobuilder/kuttl](https://github.com/kudobuilder/kuttl) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/kudobuilder/kuttl/releases)
- [Changelog](https://github.com/kudobuilder/kuttl/blob/main/RELEASE.md)
- [Commits](https://github.com/kudobuilder/kuttl/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: github.com/kudobuilder/kuttl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-23 17:55:42 +00:00
gcp-cherry-pick-bot[bot] fa8ddf5369
chore(deps): Bump actions/download-artifact from 4.1.5 to 4.1.6 (#1195) (#1199)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.5 to 4.1.6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](8caf195ad4...9c19ed7fe5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 17:40:22 +00:00
gcp-cherry-pick-bot[bot] 1bf3caf7df
chore(deps): Bump actions/upload-artifact from 4.3.2 to 4.3.3 (#1197) (#1198)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.2 to 4.3.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](1746f4ab65...65462800fd)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 17:24:53 +00:00
gcp-cherry-pick-bot[bot] bd765c8fa9
chore(deps): Bump actions/checkout from 4.1.2 to 4.1.3 (#1192) (#1194)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](9bb56186c3...1d96c772d1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 16:33:40 +00:00
gcp-cherry-pick-bot[bot] a38de0f688
fix: junit reports (#1190) (#1191)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-19 22:55:02 +02:00
gcp-cherry-pick-bot[bot] c4efea83f1
chore: fix ci jobs (#1188) (#1189)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-19 12:59:32 +02:00
gcp-cherry-pick-bot[bot] 382d7c6beb
chore: disable semantics pr check for cherry pick bot (#1186) (#1187)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-19 12:52:04 +02:00
gcp-cherry-pick-bot[bot] 931fd161d9
chore(deps): Bump actions/download-artifact from 4.1.4 to 4.1.5 (#1181) (#1185)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.4 to 4.1.5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](c850b930e6...8caf195ad4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 12:24:02 +02:00
gcp-cherry-pick-bot[bot] 453007813e
chore: update jobs to work on release branches (#1180) (#1184)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-04-19 11:58:55 +02:00
gcp-cherry-pick-bot[bot] 5a17bd4e96
chore(deps): Bump actions/upload-artifact from 4.3.1 to 4.3.2 (#1182) (#1183)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.1 to 4.3.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](5d5d22a312...1746f4ab65)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 11:39:10 +02:00
767 changed files with 39271 additions and 55998 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,14 +14,6 @@ body:
label: chainsaw version Version label: chainsaw version Version
description: What version of chainsaw are you running? description: What version of chainsaw are you running?
options: options:
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4 - v0.2.4
- v0.2.3 - v0.2.3
- v0.2.2 - v0.2.2

View File

@ -23,14 +23,6 @@ body:
label: chainsaw version Version label: chainsaw version Version
description: What version of chainsaw are you running? description: What version of chainsaw are you running?
options: options:
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4 - v0.2.4
- v0.2.3 - v0.2.3
- v0.2.2 - v0.2.2

View File

@ -1,9 +1,7 @@
version: 2 version: 2
updates: updates:
- package-ecosystem: gomod - package-ecosystem: gomod
directories: directory: /
- /
- /hack/controller-gen/
schedule: schedule:
interval: daily interval: daily
- package-ecosystem: github-actions - package-ecosystem: github-actions

View File

@ -23,9 +23,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Ensure SHA pinned actions - name: Ensure SHA pinned actions
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@fc87bb5b5a97953d987372e74478de634726b3e5 # v3.0.25 uses: zgosalvez/github-actions-ensure-sha-pinned-actions@74606c30450304eee8660aae751818321754feb1 # v3.0.9
with: with:
# slsa-github-generator requires using a semver tag for reusable workflows. # slsa-github-generator requires using a semver tag for reusable workflows.
# See: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators # See: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators

View File

@ -23,9 +23,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go - name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with: with:
go-version-file: go.mod go-version-file: go.mod
cache-dependency-path: go.sum cache-dependency-path: go.sum

View File

@ -25,11 +25,11 @@ jobs:
security-events: write security-events: write
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Run Trivy vulnerability scanner in repo mode - name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4 # v0.32.0 uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # v0.23.0
with: with:
scan-type: fs scan-type: fs
ignore-unfixed: false ignore-unfixed: false
@ -39,10 +39,8 @@ jobs:
scanners: vuln,secret scanners: vuln,secret
exit-code: '0' exit-code: '0'
vuln-type: os,library vuln-type: os,library
env:
TRIVY_DB_REPOSITORY: 'public.ecr.aws/aquasecurity/trivy-db:2'
- name: Upload Trivy scan results to GitHub Security tab - name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.5 uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
with: with:
sarif_file: trivy-results.sarif sarif_file: trivy-results.sarif
category: code category: code

View File

@ -20,9 +20,9 @@ jobs:
contents: write contents: write
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go - name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with: with:
go-version-file: go.mod go-version-file: go.mod
cache-dependency-path: go.sum cache-dependency-path: go.sum

View File

@ -23,9 +23,9 @@ jobs:
version_extractor_regex: '^docs-v(.*)$' version_extractor_regex: '^docs-v(.*)$'
- name: Checkout - name: Checkout
if: ${{ steps.semver.outputs.prerelease == '' }} if: ${{ steps.semver.outputs.prerelease == '' }}
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go - name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
if: ${{ steps.semver.outputs.prerelease == '' }} if: ${{ steps.semver.outputs.prerelease == '' }}
with: with:
go-version-file: go.mod go-version-file: go.mod

View File

@ -23,13 +23,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go - name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with: with:
go-version-file: go.mod go-version-file: go.mod
cache-dependency-path: go.sum cache-dependency-path: go.sum
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v3.7.1
with: with:
skip-cache: true skip-cache: true

View File

@ -44,9 +44,10 @@ concurrency:
jobs: jobs:
check-semantic-pr: check-semantic-pr:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.actor != 'gcp-cherry-pick-bot' }}
steps: steps:
- name: Validate Pull Request - name: Validate Pull Request
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 uses: amannn/action-semantic-pull-request@cfb60706e18bc85e8aec535e3c577abe8f70378e
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:

View File

@ -33,7 +33,7 @@ jobs:
docker-images: true docker-images: true
swap-storage: false swap-storage: false
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Fetch all tags - name: Fetch all tags
@ -41,19 +41,19 @@ jobs:
set -e set -e
git fetch --force --tags git fetch --force --tags
- name: Setup Go - name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with: with:
go-version-file: go.mod go-version-file: go.mod
cache-dependency-path: go.sum cache-dependency-path: go.sum
- name: Install Cosign - name: Install Cosign
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2 uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0
- name: Install Syft - name: Install Syft
uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4 uses: anchore/sbom-action/download-syft@e8d2a6937ecead383dfe75190d104edd1f9c5751 # v0.16.0
- name: Install Ko - name: Install Ko
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7
- name: Run GoReleaser - name: Run GoReleaser
id: goreleaser id: goreleaser
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0 uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with: with:
distribution: goreleaser distribution: goreleaser
version: latest version: latest
@ -61,14 +61,14 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts.json - name: Upload artifacts.json
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # 2.11.2 uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/artifacts.json file: dist/artifacts.json
asset_name: artifacts.json asset_name: artifacts.json
tag: ${{ github.ref }} tag: ${{ github.ref }}
- name: Upload metadata.json - name: Upload metadata.json
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # 2.11.2 uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/metadata.json file: dist/metadata.json
@ -102,7 +102,7 @@ jobs:
actions: read actions: read
id-token: write id-token: write
contents: write contents: write
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0 uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
with: with:
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}" base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
upload-assets: true upload-assets: true
@ -114,7 +114,7 @@ jobs:
actions: read actions: read
id-token: write id-token: write
packages: write packages: write
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0 uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
with: with:
image: ${{ needs.goreleaser.outputs.image }} image: ${{ needs.goreleaser.outputs.image }}
digest: ${{ needs.goreleaser.outputs.digest }} digest: ${{ needs.goreleaser.outputs.digest }}

View File

@ -23,9 +23,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go - name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with: with:
go-version-file: go.mod go-version-file: go.mod
cache-dependency-path: go.sum cache-dependency-path: go.sum
@ -38,7 +38,7 @@ jobs:
set -e set -e
make tests make tests
- name: Upload coverage - name: Upload coverage
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with: with:
name: coverage.out name: coverage.out
path: coverage.out path: coverage.out
@ -50,12 +50,14 @@ jobs:
- unit-tests - unit-tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Download coverage - name: Download coverage
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with: with:
name: coverage.out name: coverage.out
- name: Upload Report to Codecov - name: Upload Report to Codecov
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with: with:
files: ./coverage.out files: ./coverage.out
fail_ci_if_error: true fail_ci_if_error: true
@ -67,9 +69,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go - name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with: with:
go-version-file: go.mod go-version-file: go.mod
cache-dependency-path: go.sum cache-dependency-path: go.sum
@ -82,33 +84,18 @@ jobs:
set -e set -e
make e2e-tests make e2e-tests
e2e-tests-no-cluster:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Run tests
run: |
set -e
make e2e-tests-no-cluster
e2e-test-ko: e2e-test-ko:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go - name: Setup Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with: with:
go-version-file: go.mod go-version-file: go.mod
cache-dependency-path: go.sum cache-dependency-path: go.sum
- name: Install ko - name: Install ko
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d #v0.9 uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 #v0.7
- name: Create test cluster - name: Create test cluster
run: | run: |
set -e set -e

View File

@ -1,4 +1,3 @@
version: "2"
linters: linters:
enable: enable:
- asasalint - asasalint
@ -6,49 +5,46 @@ linters:
- bidichk - bidichk
- bodyclose - bodyclose
- containedctx - containedctx
- copyloopvar
- decorder - decorder
- dogsled - dogsled
- durationcheck - durationcheck
- errcheck
- errname - errname
- exportloopref
- gci
- gochecknoinits - gochecknoinits
- gofmt
- gofumpt
- goimports
- goprintffuncname - goprintffuncname
- gosec - gosec
- gosimple
- govet
- grouper - grouper
- importas - importas
- ineffassign
- makezero - makezero
- misspell - misspell
- noctx - noctx
- nolintlint - nolintlint
- nosprintfhostport - nosprintfhostport
# - paralleltest
- staticcheck
- tenv
- thelper - thelper
- tparallel - tparallel
- typecheck
- unconvert - unconvert
- usetesting - unused
- wastedassign - wastedassign
- whitespace - whitespace
exclusions:
generated: lax run:
presets: timeout: 15m
- comments
- common-false-positives output:
- legacy sort-results: true
- std-error-handling
paths: issues:
- .+\.generated.go exclude-files:
- third_party$ - ".+\\.generated.go"
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- .+\.generated.go
- third_party$
- builtin$
- examples$

View File

@ -1,5 +1,3 @@
version: 2
before: before:
hooks: hooks:
- go mod tidy - go mod tidy
@ -17,30 +15,6 @@ builds:
- -trimpath - -trimpath
ldflags: ldflags:
- -s -w -X github.com/kyverno/chainsaw/pkg/version.BuildVersion={{ .Version }} - -s -w -X github.com/kyverno/chainsaw/pkg/version.BuildVersion={{ .Version }}
- id: s390x
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- s390x
binary: chainsaw
flags:
- -trimpath
ldflags:
- -s -w -X github.com/kyverno/chainsaw/pkg/version.BuildVersion={{ .Version }}
- id: ppc64le
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- ppc64le
binary: chainsaw
flags:
- -trimpath
ldflags:
- -s -w -X github.com/kyverno/chainsaw/pkg/version.BuildVersion={{ .Version }}
kos: kos:
- build: chainsaw - build: chainsaw
@ -108,7 +82,7 @@ sboms:
artifacts: source artifacts: source
snapshot: snapshot:
version_template: '{{ incpatch .Version }}-next' name_template: '{{ incpatch .Version }}-next'
release: release:
prerelease: auto prerelease: auto

View File

@ -5,7 +5,6 @@ Release notes for `TODO`.
<!-- <!--
## ‼️ Breaking changes ‼️ ## ‼️ Breaking changes ‼️
## 💫 New features 💫
## ✨ UI changes ✨ ## ✨ UI changes ✨
@ -13,13 +12,18 @@ Release notes for `TODO`.
## ⛵ Tutorials ⛵ ## ⛵ Tutorials ⛵
## 🔧 Fixes 🔧
## 📚 Docs 📚 ## 📚 Docs 📚
## 🎸 Misc 🎸
--> -->
## 💫 New features 💫 ## 💫 New features 💫
- Continue tests when an error happens when computing the test name - Add test scenarios support
## 🔧 Fixes 🔧
- Fixed a potential issue with configuration defaults and marshaling
## 🎸 Misc 🎸
- Improved all Python-based build operations

View File

@ -1,24 +0,0 @@
# Release notes
Release notes for `v0.2.10`.
## 💫 New features 💫
- Added bindings support when referencing step templates
- Restructured the reports system
- Added reports in JSON format back
- Added new JUnit report formats with different granularity (`JUNIT-TEST`, `JUNIT-STEP`, `JUNIT-OPERATION`)
- `XML` report format should be considered deprecated and replaced with one of the `JUNIT-*` format
## 🔧 Fixes 🔧
- Fixed default report name not set correctly
- Made `template` required when referencing a step template
## 📚 Docs 📚
- Started a JMESPath function example page in the docs (only `x_k8s_get` is available at this time)
## 🎸 Misc 🎸
- Removed test `v1alpha2` API for now

View File

@ -1,17 +0,0 @@
# Release notes
Release notes for `v0.2.11`.
## 💫 New features 💫
- Added CEL support everywhere (bindings, assertion trees, projection trees, outputs...)
- Added test sharding support
## 🔧 Fixes 🔧
- Fixed exit code when failing in root test run
- Fixed `--no-cluster` flag not working
## 📚 Docs 📚
- Added most JMESPath functions docs and examples

View File

@ -1,15 +0,0 @@
# Release notes
Release notes for `v0.2.12`.
## 💫 New features 💫
- Registered Kubernetes CEL libs, optional types, and various other std libs
- Support conditions in labels in assertion templates
- Added `skipCommandOutput` support to not log the `command` and `script` being executed
## 🔧 Fixes 🔧
- Allow escaping dollar sign in `command` and `script`
- Fixed `chainsaw build docs` rendering invalid yaml
- Fixed step template bindings registered in the wrong order

View File

@ -1,15 +0,0 @@
# Release notes
Release notes for `v0.2.5`.
## 💫 New features 💫
- Add test scenarios support
## 🔧 Fixes 🔧
- Fixed a potential issue with configuration defaults and marshaling
## 🎸 Misc 🎸
- Improved all Python-based build operations

View File

@ -1,9 +0,0 @@
# Release notes
Release notes for `v0.2.6`.
## 💫 New features 💫
- Added a `proxy` action to allow HTTP calls to in-cluster services and pods
- Added `as_string` JMESPath function to convert types based on strings to bare strings
- Added `x_metrics_decode` JMESPath function to decode Prometheus metrics

View File

@ -1,18 +0,0 @@
# Release notes
Release notes for `v0.2.7`.
## 💫 New features 💫
- Added initial `TestTemplate` support to allow defining steps in separate files and reusing them across tests
- Replaced programmatic validation with schema-based validation
- Better generated JSON schemas based on OpenAPI v3 instead of v2
## 🔧 Fixes 🔧
- Fixed incorrect `null` vs empty object comparison in assertion operations
## 📚 Docs 📚
- Added detailed community pages to the website website
- Added a CODE_OF_CONDUCT.md file in the repo

View File

@ -1,21 +0,0 @@
# Release notes
Release notes for `v0.2.8`.
## 💫 New features 💫
- Added `chainsaw renovate config` to upgrade configuration manifests to `v1alpha2`
- Changed `cluster` in test step and actions to a pointer
- `null` means inherit the current cluster
- an empty string means the default cluster
- Made default timeouts part of the schemas
- Added support to fail fast at the test level (test will be skipped if a previous error was already reported)
- Delay operation loading until operation execution
- Generate strict JSON schemas
## 🔧 Fixes 🔧
- Fixed incorrect bindings when operations are run against different clusters
- Fixed operation info built-in bindings not registered before other bindings
- Fixed incorrect cluster client used when applying the test namespace to resources
- Detect accessing nodes not present in the payload when traversing an assertion tree

View File

@ -1,19 +0,0 @@
# Release notes
Release notes for `v0.2.9`.
## 💫 New features 💫
- Added support for templating filenames used in operations
- Added `ppc64le` and `s390x` binaries in release artifacts
- Added support for Kubernetes 1.31
- Added server side validation to validate the submitted resource
- Added support for overriding the working directory in `command` and `script` operations
- Compile string expressions at loading time
- Made json path value optional in `wait` operation
- Improved logging with `begin`, `end` and `warning` statuses
- Added golang 1.23 support
## 🔧 Fixes 🔧
- Fixed configuration `v1alpha2` lint command

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1
.vscode/launch.json vendored
View File

@ -16,7 +16,6 @@
"./testdata/e2e/examples", "./testdata/e2e/examples",
"--config", "--config",
"./testdata/e2e/config.yaml", "./testdata/e2e/config.yaml",
"--remarshal",
] ]
}, },
{ {

View File

@ -9,7 +9,6 @@ The list of organizations that have publicly shared the usage of Chainsaw:
| Organization | Success Story | | Organization | Success Story |
|:--|:--| |:--|:--|
| [Keptn](https://github.com/keptn/lifecycle-toolkit)| Chainsaw replaced Kuttl, and helped us get rid of many unreadable bash scripts | | [Keptn](https://github.com/keptn/lifecycle-toolkit)| Chainsaw replaced Kuttl, and helped us get rid of many unreadable bash scripts |
| [OpenFeature](https://github.com/open-feature/open-feature-operator)| Chainsaw replaced Kuttl, helped us improve logging and remove native kubectl calls |
| [Kyverno](https://kyverno.io) | Running all end to end tests for both Kyverno and the policies catalog | | [Kyverno](https://kyverno.io) | Running all end to end tests for both Kyverno and the policies catalog |
| [Nirmata](https://nirmata.com/) | Using Chainsaw extensively to test curated Kyverno policies, Kyverno Operator and other e2e internal testing | | [Nirmata](https://nirmata.com/) | Using Chainsaw extensively to test curated Kyverno policies, Kyverno Operator and other e2e internal testing |
| [Redis-operator](https://github.com/OT-CONTAINER-KIT/redis-operator) | Chainsaw helped a lot for declarative assertion of Redis Cluster state against various e2e test | | [Redis-operator](https://github.com/OT-CONTAINER-KIT/redis-operator) | Chainsaw helped a lot for declarative assertion of Redis Cluster state against various e2e test |
@ -21,7 +20,6 @@ The list of organizations that have publicly shared the usage of Chainsaw:
| [Provider-ceph](https://github.com/linode/provider-ceph) | Chainsaw replaced Kuttl and made our e2e tests much more readable and easier to debug | | [Provider-ceph](https://github.com/linode/provider-ceph) | Chainsaw replaced Kuttl and made our e2e tests much more readable and easier to debug |
| [Linode CAPI provider](https://github.com/linode/cluster-api-provider-linode) | Chainsaw replaced Kuttl and made our e2e tests much more readable and easier to debug. 🙏 @eddycharly | | [Linode CAPI provider](https://github.com/linode/cluster-api-provider-linode) | Chainsaw replaced Kuttl and made our e2e tests much more readable and easier to debug. 🙏 @eddycharly |
| [Linode COSI driver](https://github.com/linode/linode-cosi-driver) | Running all end to end tests for object store driver | | [Linode COSI driver](https://github.com/linode/linode-cosi-driver) | Running all end to end tests for object store driver |
| [Odigos](https://github.com/odigos-io/odigos) | Chainsaw helps us run complex e2e tests confidently, ensuring project reliability. |
<!-- append the line below to the table <!-- append the line below to the table

View File

@ -1,74 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for our community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team privately at hello@squidfunk.com. The
project team will review and investigate all complaints, and will respond in a
way that it deems appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
incident. Further details of specific enforcement policies may be posted
separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@ -7,6 +7,9 @@
GIT_SHA := $(shell git rev-parse HEAD) GIT_SHA := $(shell git rev-parse HEAD)
ORG ?= kyverno ORG ?= kyverno
PACKAGE ?= github.com/$(ORG)/chainsaw PACKAGE ?= github.com/$(ORG)/chainsaw
GOPATH_SHIM := ${PWD}/.gopath
PACKAGE_SHIM := $(GOPATH_SHIM)/src/$(PACKAGE)
INPUT_DIRS := $(PACKAGE)/pkg/apis/v1alpha1,$(PACKAGE)/pkg/apis/v1alpha2
CRDS_PATH := ${PWD}/.crds CRDS_PATH := ${PWD}/.crds
CLI_BIN := chainsaw CLI_BIN := chainsaw
CGO_ENABLED ?= 0 CGO_ENABLED ?= 0
@ -18,7 +21,7 @@ LD_FLAGS := "-s -w"
endif endif
KO_REGISTRY := ko.local KO_REGISTRY := ko.local
KO_TAGS := $(GIT_SHA) KO_TAGS := $(GIT_SHA)
KIND_IMAGE ?= kindest/node:v1.33.2 KIND_IMAGE ?= kindest/node:v1.29.2
######### #########
# TOOLS # # TOOLS #
@ -26,16 +29,17 @@ KIND_IMAGE ?= kindest/node:v1.33.2
TOOLS_DIR := $(PWD)/.tools TOOLS_DIR := $(PWD)/.tools
CONTROLLER_GEN := $(TOOLS_DIR)/controller-gen CONTROLLER_GEN := $(TOOLS_DIR)/controller-gen
CONTROLLER_GEN_VERSION := v0.15.0
REGISTER_GEN := $(TOOLS_DIR)/register-gen REGISTER_GEN := $(TOOLS_DIR)/register-gen
DEEPCOPY_GEN := $(TOOLS_DIR)/deepcopy-gen DEEPCOPY_GEN := $(TOOLS_DIR)/deepcopy-gen
CONVERSION_GEN := $(TOOLS_DIR)/conversion-gen CONVERSION_GEN := $(TOOLS_DIR)/conversion-gen
CODE_GEN_VERSION := v0.33.3 CODE_GEN_VERSION := v0.28.0
REFERENCE_DOCS := $(TOOLS_DIR)/genref REFERENCE_DOCS := $(TOOLS_DIR)/genref
REFERENCE_DOCS_VERSION := latest REFERENCE_DOCS_VERSION := latest
KIND := $(TOOLS_DIR)/kind KIND := $(TOOLS_DIR)/kind
KIND_VERSION := v0.29.0 KIND_VERSION := v0.22.0
KO ?= $(TOOLS_DIR)/ko KO ?= $(TOOLS_DIR)/ko
KO_VERSION ?= v0.18.0 KO_VERSION ?= v0.15.1
TOOLS := $(CONTROLLER_GEN) $(REGISTER_GEN) $(DEEPCOPY_GEN) $(CONVERSION_GEN) $(REFERENCE_DOCS) $(KIND) $(KO) TOOLS := $(CONTROLLER_GEN) $(REGISTER_GEN) $(DEEPCOPY_GEN) $(CONVERSION_GEN) $(REFERENCE_DOCS) $(KIND) $(KO)
PIP ?= "pip" PIP ?= "pip"
ifeq ($(GOOS), darwin) ifeq ($(GOOS), darwin)
@ -47,7 +51,7 @@ COMMA := ,
$(CONTROLLER_GEN): $(CONTROLLER_GEN):
@echo Install controller-gen... >&2 @echo Install controller-gen... >&2
@cd ./hack/controller-gen && GOBIN=$(TOOLS_DIR) go install -buildvcs=false @GOBIN=$(TOOLS_DIR) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION)
$(REGISTER_GEN): $(REGISTER_GEN):
@echo Install register-gen... >&2 @echo Install register-gen... >&2
@ -86,32 +90,43 @@ clean-tools: ## Remove installed tools
# CODEGEN # # CODEGEN #
########### ###########
$(GOPATH_SHIM):
@echo Create gopath shim... >&2
@mkdir -p $(GOPATH_SHIM)
.INTERMEDIATE: $(PACKAGE_SHIM)
$(PACKAGE_SHIM): $(GOPATH_SHIM)
@echo Create package shim... >&2
@mkdir -p $(GOPATH_SHIM)/src/github.com/$(ORG) && ln -s -f ${PWD} $(PACKAGE_SHIM)
.PHONY: codegen-register .PHONY: codegen-register
codegen-register: ## Generate types registrations codegen-register: ## Generate types registrations
codegen-register: $(PACKAGE_SHIM)
codegen-register: $(REGISTER_GEN) codegen-register: $(REGISTER_GEN)
@echo Generate registration... >&2 @echo Generate registration... >&2
@$(REGISTER_GEN) \ @GOPATH=$(GOPATH_SHIM) $(REGISTER_GEN) \
--go-header-file=./hack/boilerplate.go.txt \ --go-header-file=./.hack/boilerplate.go.txt \
--output-file zz_generated.register.go \ --input-dirs=$(INPUT_DIRS)
./pkg/apis/...
.PHONY: codegen-deepcopy .PHONY: codegen-deepcopy
codegen-deepcopy: ## Generate deep copy functions codegen-deepcopy: ## Generate deep copy functions
codegen-deepcopy: $(PACKAGE_SHIM)
codegen-deepcopy: $(DEEPCOPY_GEN) codegen-deepcopy: $(DEEPCOPY_GEN)
@echo Generate deep copy functions... >&2 @echo Generate deep copy functions... >&2
@$(DEEPCOPY_GEN) \ @GOPATH=$(GOPATH_SHIM) $(DEEPCOPY_GEN) \
--go-header-file=./hack/boilerplate.go.txt \ --go-header-file=./.hack/boilerplate.go.txt \
--output-file=zz_generated.deepcopy.go \ --input-dirs=$(INPUT_DIRS) \
./pkg/apis/... --output-file-base=zz_generated.deepcopy
.PHONY: codegen-conversion .PHONY: codegen-conversion
codegen-conversion: ## Generate conversion functions codegen-conversion: ## Generate conversion functions
codegen-conversion: $(PACKAGE_SHIM)
codegen-conversion: $(CONVERSION_GEN) codegen-conversion: $(CONVERSION_GEN)
@echo Generate conversion functions... >&2 @echo Generate conversion functions... >&2
@$(CONVERSION_GEN) \ @GOPATH=$(GOPATH_SHIM) $(CONVERSION_GEN) \
--go-header-file=./hack/boilerplate.go.txt \ --go-header-file=./.hack/boilerplate.go.txt \
--output-file=zz_generated.conversion.go \ --input-dirs=$(INPUT_DIRS) \
./pkg/apis/... --output-file-base=zz_generated.conversion
.PHONY: codegen-crds .PHONY: codegen-crds
codegen-crds: ## Generate CRDs codegen-crds: ## Generate CRDs
@ -121,7 +136,7 @@ codegen-crds: codegen-register
codegen-crds: codegen-conversion codegen-crds: codegen-conversion
@echo Generate crds... >&2 @echo Generate crds... >&2
@rm -rf $(CRDS_PATH) @rm -rf $(CRDS_PATH)
@$(CONTROLLER_GEN) paths=./pkg/apis/... crd:crdVersions=v1,ignoreUnexportedFields=true,generateEmbeddedObjectMeta=false output:dir=$(CRDS_PATH) @$(CONTROLLER_GEN) paths=./pkg/apis/... crd:crdVersions=v1 output:dir=$(CRDS_PATH)
@echo Copy generated CRDs to embed in the CLI... >&2 @echo Copy generated CRDs to embed in the CLI... >&2
@rm -rf pkg/data/crds && mkdir -p pkg/data/crds @rm -rf pkg/data/crds && mkdir -p pkg/data/crds
@cp $(CRDS_PATH)/* pkg/data/crds @cp $(CRDS_PATH)/* pkg/data/crds
@ -130,7 +145,8 @@ codegen-crds: codegen-conversion
codegen-cli-docs: ## Generate CLI docs codegen-cli-docs: ## Generate CLI docs
codegen-cli-docs: build codegen-cli-docs: build
@echo Generate cli docs... >&2 @echo Generate cli docs... >&2
@rm -rf website/docs/reference/commands && mkdir -p website/docs/reference/commands @rm -rf website/docs/reference/commands && mkdir -p website/reference/docs/commands
@rm -rf docs/user/commands && mkdir -p docs/user/commands
@./$(CLI_BIN) docs -o website/docs/reference/commands --autogenTag=false @./$(CLI_BIN) docs -o website/docs/reference/commands --autogenTag=false
.PHONY: codegen-api-docs .PHONY: codegen-api-docs
@ -146,7 +162,7 @@ codegen-api-docs: codegen-conversion
.PHONY: codegen-jp-docs .PHONY: codegen-jp-docs
codegen-jp-docs: ## Generate JP docs codegen-jp-docs: ## Generate JP docs
@echo Generate jp docs... >&2 @echo Generate jp docs... >&2
@mkdir -p ./website/docs/reference/jp @rm -rf ./website/docs/reference/jp && mkdir -p ./website/docs/reference/jp
@go run ./website/jp/main.go > ./website/docs/reference/jp/functions.md @go run ./website/jp/main.go > ./website/docs/reference/jp/functions.md
.PHONY: codegen-mkdocs .PHONY: codegen-mkdocs
@ -183,12 +199,10 @@ codegen-schemas-json: codegen-schemas-openapi
@$(PIP) install -r requirements.txt @$(PIP) install -r requirements.txt
@rm -rf ./.temp/.schemas/json @rm -rf ./.temp/.schemas/json
@rm -rf ./.schemas/json @rm -rf ./.schemas/json
@openapi2jsonschema .temp/.schemas/openapi/v3/apis/chainsaw.kyverno.io/v1alpha1.json --kubernetes --strict --stand-alone --expanded -o ./.temp/.schemas/json @openapi2jsonschema ./.temp/.schemas/openapi/v2/schema.json --kubernetes --stand-alone --expanded -o ./.temp/.schemas/json
@openapi2jsonschema .temp/.schemas/openapi/v3/apis/chainsaw.kyverno.io/v1alpha2.json --kubernetes --strict --stand-alone --expanded -o ./.temp/.schemas/json
@mkdir -p ./.schemas/json @mkdir -p ./.schemas/json
@cp ./.temp/.schemas/json/configuration-chainsaw-*.json ./.schemas/json
@cp ./.temp/.schemas/json/steptemplate-chainsaw-*.json ./.schemas/json
@cp ./.temp/.schemas/json/test-chainsaw-*.json ./.schemas/json @cp ./.temp/.schemas/json/test-chainsaw-*.json ./.schemas/json
@cp ./.temp/.schemas/json/configuration-chainsaw-*.json ./.schemas/json
@echo Copy generated schemas to embed in the CLI... >&2 @echo Copy generated schemas to embed in the CLI... >&2
@rm -rf pkg/data/schemas/json && mkdir -p pkg/data/schemas/json @rm -rf pkg/data/schemas/json && mkdir -p pkg/data/schemas/json
@cp ./.schemas/json/* pkg/data/schemas/json @cp ./.schemas/json/* pkg/data/schemas/json
@ -226,7 +240,7 @@ verify-codegen: codegen
.PHONY: mkdocs-serve .PHONY: mkdocs-serve
mkdocs-serve: ## Generate and serve mkdocs website mkdocs-serve: ## Generate and serve mkdocs website
@echo Generate and serve mkdocs website... >&2 @echo Generate and servemkdocs website... >&2
@$(PIP) install -r requirements.txt @$(PIP) install -r requirements.txt
@mkdocs serve -f ./website/mkdocs.yaml @mkdocs serve -f ./website/mkdocs.yaml
@ -283,14 +297,7 @@ tests: $(CLI_BIN)
e2e-tests: ## Run e2e tests e2e-tests: ## Run e2e tests
e2e-tests: $(CLI_BIN) e2e-tests: $(CLI_BIN)
@echo Running e2e tests... >&2 @echo Running e2e tests... >&2
@./$(CLI_BIN) test ./testdata/e2e --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml @./$(CLI_BIN) test --test-dir ./testdata/e2e --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml
.PHONY: e2e-tests-no-cluster
e2e-tests-no-cluster: ## Run e2e tests with --no-cluster
e2e-tests-no-cluster: $(CLI_BIN)
@echo Running e2e tests with --no-cluster... >&2
@./$(CLI_BIN) test testdata/e2e/examples/script-env --no-cluster --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml
@./$(CLI_BIN) test testdata/e2e/examples/dynamic-clusters --no-cluster --remarshal --config ./testdata/e2e/config.yaml --values ./testdata/e2e/values.yaml
.PHONY: e2e-tests-ko .PHONY: e2e-tests-ko
e2e-tests-ko: ## Run e2e tests from a docker container e2e-tests-ko: ## Run e2e tests from a docker container

View File

@ -51,7 +51,7 @@ To attend our community meetings, join the [Chainsaw group](https://groups.googl
You will then be sent a meeting invite and will have access to the agenda and meeting notes. You will then be sent a meeting invite and will have access to the agenda and meeting notes.
Any member may suggest topics for discussion. Any member may suggest topics for discussion.
This is a public, weekly meeting for Kyverno-Chainsaw maintainers to make announcements and provide project updates, and request input and feedback. This is a public, weekly for Kyverno-Chainsaw maintainers to make announcements and provide project updates, and request input and feedback.
This forum allows community members to raise agenda items of any sort, including but not limited to any PRs or issues on which they are working. This forum allows community members to raise agenda items of any sort, including but not limited to any PRs or issues on which they are working.
Weekly every Thursday at 2:00 PM UTC Weekly every Thursday at 2:00 PM UTC

View File

@ -5,20 +5,20 @@
class Chainsaw < Formula class Chainsaw < Formula
desc "Declarative Kubernetes end-to-end testing." desc "Declarative Kubernetes end-to-end testing."
homepage "https://kyverno.github.io/chainsaw" homepage "https://kyverno.github.io/chainsaw"
version "0.2.12" version "0.1.9"
on_macos do on_macos do
on_intel do if Hardware::CPU.arm?
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_darwin_amd64.tar.gz" url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_darwin_arm64.tar.gz"
sha256 "b49dba1214b32024567b1edc7653498a644fbef18111bcc3e1c46dc52e1d194e" sha256 "4187956ba26fd5dadf6552bfa77e769afdac48c08e5741c46a8e38b07ca708bc"
def install def install
bin.install "chainsaw" bin.install "chainsaw"
end end
end end
on_arm do if Hardware::CPU.intel?
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_darwin_arm64.tar.gz" url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_darwin_amd64.tar.gz"
sha256 "717a07fcc4d781fff967b287880fed1d8b1e6af9fbecc7650a714c467f296d33" sha256 "8c65f3ee952aa04754d644f2ef3d5f489153638de4e71de6348d4628e5af0378"
def install def install
bin.install "chainsaw" bin.install "chainsaw"
@ -27,24 +27,20 @@ class Chainsaw < Formula
end end
on_linux do on_linux do
on_intel do if Hardware::CPU.intel?
if Hardware::CPU.is_64_bit? url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_linux_amd64.tar.gz"
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_linux_amd64.tar.gz" sha256 "4080d3bb5ea6de6f85198e413e24a5c7aee941f027ba8b545f7a1ddbaa2e2856"
sha256 "d6bfb17ba47af2db85edc0365288f92b5e1a4566f7ff130ec9b326f96856e209"
def install def install
bin.install "chainsaw" bin.install "chainsaw"
end
end end
end end
on_arm do if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
if Hardware::CPU.is_64_bit? url "https://github.com/kyverno/chainsaw/releases/download/v0.1.9/chainsaw_linux_arm64.tar.gz"
url "https://github.com/kyverno/chainsaw/releases/download/v0.2.12/chainsaw_linux_arm64.tar.gz" sha256 "05f2cdce3f34989e71f47cd30e005a49fa8d7abefbede20311f96eed016a34b8"
sha256 "72a6273d6da16a04e29e0fae232631b084852d21ddf25f88ed3d3de480125d30"
def install def install
bin.install "chainsaw" bin.install "chainsaw"
end
end end
end end
end end

View File

@ -1,6 +1,5 @@
ignore: ignore:
- 'hack/**/*.go' - ^pkg/apis/v1alpha1/zz_generated\.deepcopy\.go$
- 'website/**/*.go' - ^pkg/apis/v1alpha1/zz_generated\.register\.go$
- 'pkg/apis/**/zz_*.go' - ^pkg/testing/.*\.go$
- 'pkg/testing/*.go' - ^.*_test\.go$
- '**/*_test.go'

184
go.mod
View File

@ -1,105 +1,94 @@
module github.com/kyverno/chainsaw module github.com/kyverno/chainsaw
go 1.24.2 go 1.22.2
require ( require (
github.com/Masterminds/sprig v2.22.0+incompatible github.com/Masterminds/sprig v2.22.0+incompatible
github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0 github.com/dustinkirkland/golang-petname v0.0.0-20240428194347-eebcea082ee0
github.com/evanphx/json-patch v5.9.11+incompatible github.com/fatih/color v1.17.0
github.com/fatih/color v1.18.0 github.com/go-logr/logr v1.4.2
github.com/go-logr/logr v1.4.3
github.com/google/cel-go v0.23.2
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/hashicorp/go-getter v1.7.8 github.com/hashicorp/go-getter v1.7.4
github.com/jmespath-community/go-jmespath v1.1.2-0.20240930152130-6eb5a346873f github.com/jmespath-community/go-jmespath v1.1.2-0.20240117150817-e430401a2172
github.com/jstemmer/go-junit-report/v2 v2.1.0 github.com/kudobuilder/kuttl v0.17.0
github.com/kudobuilder/kuttl v0.20.0 github.com/kyverno/kyverno-json v0.0.3
github.com/kyverno/kyverno-json v0.0.4-0.20241008103124-b294ee72a2bf
github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c github.com/kyverno/pkg/ext v0.0.0-20240418121121-df8add26c55c
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/prometheus/common v0.65.0 github.com/spf13/cobra v1.8.1
github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.5
github.com/spf13/pflag v1.0.7 github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
github.com/xeipuuv/gojsonschema v1.2.0 github.com/xeipuuv/gojsonschema v1.2.0
go.uber.org/multierr v1.11.0 go.uber.org/multierr v1.11.0
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.33.3 k8s.io/api v0.30.2
k8s.io/apimachinery v0.33.3 k8s.io/apimachinery v0.30.2
k8s.io/apiserver v0.33.3 k8s.io/client-go v0.30.2
k8s.io/client-go v0.33.3 k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/controller-runtime v0.21.0 sigs.k8s.io/kubectl-validate v0.0.4
sigs.k8s.io/kubectl-validate v0.0.5-0.20241223122011-eb064d2f92d5 sigs.k8s.io/yaml v1.4.0
sigs.k8s.io/yaml v1.6.0
) )
require ( require (
cel.dev/expr v0.19.1 // indirect cloud.google.com/go v0.114.0 // indirect
cloud.google.com/go v0.115.1 // indirect cloud.google.com/go/auth v0.5.1 // indirect
cloud.google.com/go/auth v0.9.7 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect cloud.google.com/go/compute/metadata v0.3.0 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect cloud.google.com/go/iam v1.1.8 // indirect
cloud.google.com/go/iam v1.2.1 // indirect cloud.google.com/go/storage v1.41.0 // indirect
cloud.google.com/go/monitoring v1.21.1 // indirect
cloud.google.com/go/storage v1.44.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect
github.com/IGLOU-EU/go-wildcard v1.0.3 // indirect github.com/IGLOU-EU/go-wildcard v1.0.3 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/aquilax/truncate v1.0.1 // indirect github.com/aquilax/truncate v1.0.0 // indirect
github.com/aws/aws-sdk-go v1.55.6 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go v1.53.14 // indirect
github.com/beorn7/perks v1.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/blang/semver/v4 v4.0.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 // indirect
github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.1 // indirect github.com/emicklei/go-restful/v3 v3.12.1 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.3 // indirect github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.1.3 // indirect github.com/google/cel-go v0.17.8 // indirect
github.com/google/gnostic-models v0.6.9 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-cmp v0.7.0 // indirect github.com/google/go-cmp v0.6.0 // indirect
github.com/google/s2a-go v0.1.8 // indirect github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/googleapis/gax-go/v2 v2.12.4 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20210315223345-82c243799c99 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20210315223345-82c243799c99 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect github.com/json-iterator/go v1.1.12 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/klauspost/compress v1.18.0 // indirect github.com/klauspost/compress v1.17.8 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-isatty v0.0.20 // indirect
@ -111,59 +100,52 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_golang v1.22.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.47.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect github.com/prometheus/procfs v0.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect github.com/ulikunitz/xz v0.5.12 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/zach-klippenstein/goregen v0.0.0-20160303162051-795b5e3961ea // indirect github.com/zach-klippenstein/goregen v0.0.0-20160303162051-795b5e3961ea // indirect
go.etcd.io/etcd/api/v3 v3.5.21 // indirect go.etcd.io/etcd/api/v3 v3.5.14 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.21 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect
go.etcd.io/etcd/client/v3 v3.5.21 // indirect go.etcd.io/etcd/client/v3 v3.5.14 // indirect
go.opencensus.io v0.24.0 // indirect go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.29.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.23.1 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.23.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 // indirect go.opentelemetry.io/otel/sdk v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.33.0 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
go.uber.org/zap v1.27.0 // indirect go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect golang.org/x/crypto v0.23.0 // indirect
golang.org/x/crypto v0.38.0 // indirect golang.org/x/net v0.25.0 // indirect
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/net v0.40.0 // indirect golang.org/x/sync v0.7.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect golang.org/x/sys v0.20.0 // indirect
golang.org/x/sync v0.14.0 // indirect golang.org/x/term v0.20.0 // indirect
golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.15.0 // indirect
golang.org/x/term v0.32.0 // indirect golang.org/x/time v0.5.0 // indirect
golang.org/x/text v0.25.0 // indirect google.golang.org/api v0.182.0 // indirect
golang.org/x/time v0.11.0 // indirect google.golang.org/genproto v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/api v0.199.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect google.golang.org/grpc v1.64.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/grpc v1.68.1 // indirect
google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/apiextensions-apiserver v0.33.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/component-base v0.33.3 // indirect k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect k8s.io/apiserver v0.30.1 // indirect
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect k8s.io/component-base v0.30.1 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect k8s.io/klog/v2 v2.120.1 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect
sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
) )

1155
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
module github.com/kyverno/chainsaw/hack/controller-gen
go 1.24.0
require (
github.com/spf13/cobra v1.9.1
k8s.io/apiextensions-apiserver v0.33.3
sigs.k8s.io/controller-tools v0.17.2
)
require (
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/tools v0.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/apimachinery v0.33.3 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

View File

@ -1,135 +0,0 @@
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4=
github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/apiextensions-apiserver v0.33.3 h1:qmOcAHN6DjfD0v9kxL5udB27SRP6SG/MTopmge3MwEs=
k8s.io/apiextensions-apiserver v0.33.3/go.mod h1:oROuctgo27mUsyp9+Obahos6CWcMISSAPzQ77CAQGz8=
k8s.io/apimachinery v0.33.3 h1:4ZSrmNa0c/ZpZJhAgRdcsFcZOw1PQU1bALVQ0B3I5LA=
k8s.io/apimachinery v0.33.3/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e h1:KqK5c/ghOm8xkHYhlodbp6i6+r+ChV2vuAuVRdFbLro=
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/controller-tools v0.17.2 h1:jNFOKps8WnaRKZU2R+4vRCHnXyJanVmXBWqkuUPFyFg=
sigs.k8s.io/controller-tools v0.17.2/go.mod h1:4q5tZG2JniS5M5bkiXY2/potOiXyhoZVw/U48vLkXk0=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc=
sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

View File

@ -1,116 +0,0 @@
package main
import (
"fmt"
"os"
"strings"
"github.com/spf13/cobra"
"sigs.k8s.io/controller-tools/pkg/crd"
"sigs.k8s.io/controller-tools/pkg/genall"
"sigs.k8s.io/controller-tools/pkg/markers"
)
var (
allGenerators = map[string]genall.Generator{
"crd": crd.Generator{},
}
allOutputRules = map[string]genall.OutputRule{
"dir": genall.OutputToDirectory(""),
"none": genall.OutputToNothing,
"stdout": genall.OutputToStdout,
"artifacts": genall.OutputArtifacts{},
}
optionsRegistry = &markers.Registry{}
)
func init() { //nolint:gochecknoinits
for genName, gen := range allGenerators {
// make the generator options marker itself
defn := markers.Must(markers.MakeDefinition(genName, markers.DescribesPackage, gen))
if err := optionsRegistry.Register(defn); err != nil {
panic(err)
}
if helpGiver, hasHelp := gen.(genall.HasHelp); hasHelp {
if help := helpGiver.Help(); help != nil {
optionsRegistry.AddHelp(defn, help)
}
}
// make per-generation output rule markers
for ruleName, rule := range allOutputRules {
ruleMarker := markers.Must(markers.MakeDefinition(fmt.Sprintf("output:%s:%s", genName, ruleName), markers.DescribesPackage, rule))
if err := optionsRegistry.Register(ruleMarker); err != nil {
panic(err)
}
if helpGiver, hasHelp := rule.(genall.HasHelp); hasHelp {
if help := helpGiver.Help(); help != nil {
optionsRegistry.AddHelp(ruleMarker, help)
}
}
}
}
// make "default output" output rule markers
for ruleName, rule := range allOutputRules {
ruleMarker := markers.Must(markers.MakeDefinition("output:"+ruleName, markers.DescribesPackage, rule))
if err := optionsRegistry.Register(ruleMarker); err != nil {
panic(err)
}
if helpGiver, hasHelp := rule.(genall.HasHelp); hasHelp {
if help := helpGiver.Help(); help != nil {
optionsRegistry.AddHelp(ruleMarker, help)
}
}
}
// add in the common options markers
if err := genall.RegisterOptionsMarkers(optionsRegistry); err != nil {
panic(err)
}
}
type noUsageError struct{ error }
func main() {
cmd := &cobra.Command{
Use: "controller-gen",
RunE: func(c *cobra.Command, rawOpts []string) error {
oneOf, err := markers.MakeAnyTypeDefinition("kubebuilder:oneOf", markers.DescribesType, OneOf{})
if err != nil {
return err
}
not, err := markers.MakeAnyTypeDefinition("kubebuilder:not", markers.DescribesType, Not{})
if err != nil {
return err
}
// otherwise, set up the runtime for actually running the generators
rt, err := genall.FromOptions(optionsRegistry, rawOpts)
if err != nil {
return err
}
if err := rt.Collector.Registry.Register(oneOf); err != nil {
return err
}
if err := rt.Collector.Registry.Register(not); err != nil {
return err
}
if len(rt.Generators) == 0 {
return fmt.Errorf("no generators specified")
}
if hadErrs := rt.Run(); hadErrs {
// don't obscure the actual error with a bunch of usage
return noUsageError{fmt.Errorf("not all generators ran successfully")}
}
return nil
},
SilenceUsage: true, // silence the usage, then print it out ourselves if it wasn't suppressed
}
if err := cmd.Execute(); err != nil {
if _, noUsage := err.(noUsageError); !noUsage {
// print the usage unless we suppressed it
if err := cmd.Usage(); err != nil {
panic(err)
}
}
fmt.Fprintf(cmd.OutOrStderr(), "run `%[1]s %[2]s -w` to see all available markers, or `%[1]s %[2]s -h` for usage\n", cmd.CalledAs(), strings.Join(os.Args[1:], " "))
os.Exit(1)
}
}

View File

@ -1,37 +0,0 @@
package main
import (
"encoding/json"
apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
type OneOf struct {
Value any
}
func (m OneOf) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
var props apiext.JSONSchemaProps
if data, err := json.Marshal(m.Value); err != nil {
return err
} else if err := json.Unmarshal(data, &props); err != nil {
return err
}
schema.OneOf = append(schema.OneOf, props)
return nil
}
type Not struct {
Value any
}
func (m Not) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
var props apiext.JSONSchemaProps
if data, err := json.Marshal(m.Value); err != nil {
return err
} else if err := json.Unmarshal(data, &props); err != nil {
return err
}
schema.Not = &props
return nil
}

View File

@ -1,45 +0,0 @@
package apis
import (
"sync"
gocel "github.com/google/cel-go/cel"
"github.com/jmespath-community/go-jmespath/pkg/binding"
"github.com/kyverno/chainsaw/pkg/engine/functions"
"github.com/kyverno/kyverno-json/pkg/core/compilers"
"github.com/kyverno/kyverno-json/pkg/core/compilers/cel"
"github.com/kyverno/kyverno-json/pkg/core/compilers/jp"
"k8s.io/apiserver/pkg/cel/library"
)
var (
env = sync.OnceValues(func() (*gocel.Env, error) {
env, err := cel.DefaultEnv()
if err != nil {
return nil, err
}
return env.Extend(
library.URLs(),
library.Regex(),
library.Lists(),
library.Authz(),
library.Quantity(),
library.IP(),
library.CIDR(),
library.Format(),
library.AuthzSelectors(),
)
})
defaultCompilers = compilers.Compilers{
Jp: jp.NewCompiler(jp.WithFunctionCaller(functions.Caller())),
Cel: cel.NewCompiler(env),
}
DefaultCompilers = defaultCompilers.WithDefaultCompiler(compilers.CompilerJP)
)
type Bindings = binding.Bindings
var (
NewBinding = binding.NewBinding
NewBindings = binding.NewBindings
)

View File

@ -1,103 +0,0 @@
package conversion
import (
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha2"
"k8s.io/apimachinery/pkg/conversion"
)
func Convert_v1alpha2_ConfigurationSpec_To_v1alpha1_ConfigurationSpec(in *v1alpha2.ConfigurationSpec, out *v1alpha1.ConfigurationSpec, _ conversion.Scope) error {
out.SkipDelete = in.Cleanup.SkipDelete
out.DelayBeforeCleanup = in.Cleanup.DelayBeforeCleanup
out.Clusters = in.Clusters
out.DeletionPropagationPolicy = in.Deletion.Propagation
out.ExcludeTestRegex = in.Discovery.ExcludeTestRegex
out.IncludeTestRegex = in.Discovery.IncludeTestRegex
out.TestFile = in.Discovery.TestFile
out.FullName = in.Discovery.FullName
out.Catch = in.Error.Catch
out.FailFast = in.Execution.FailFast
out.Parallel = in.Execution.Parallel
out.RepeatCount = in.Execution.RepeatCount
out.ForceTerminationGracePeriod = in.Execution.ForceTerminationGracePeriod
out.Namespace = in.Namespace.Name
out.NamespaceTemplate = in.Namespace.Template
out.NamespaceTemplateCompiler = in.Namespace.Compiler
if in := in.Report; in != nil {
out.ReportFormat = v1alpha1.ReportFormatType(in.Format)
out.ReportPath = in.Path
out.ReportName = in.Name
}
out.Template = in.Templating.Enabled
out.Compiler = in.Templating.Compiler
out.Timeouts = in.Timeouts
return nil
}
func Convert_v1alpha1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(in *v1alpha1.ConfigurationSpec, out *v1alpha2.ConfigurationSpec, _ conversion.Scope) error {
out.Cleanup = v1alpha2.CleanupOptions{
SkipDelete: in.SkipDelete,
DelayBeforeCleanup: in.DelayBeforeCleanup,
}
out.Clusters = in.Clusters
out.Deletion = v1alpha2.DeletionOptions{
Propagation: in.DeletionPropagationPolicy,
}
out.Discovery = v1alpha2.DiscoveryOptions{
ExcludeTestRegex: in.ExcludeTestRegex,
IncludeTestRegex: in.IncludeTestRegex,
TestFile: in.TestFile,
FullName: in.FullName,
}
out.Error = v1alpha2.ErrorOptions{
Catch: in.Catch,
}
out.Execution = v1alpha2.ExecutionOptions{
FailFast: in.FailFast,
Parallel: in.Parallel,
RepeatCount: in.RepeatCount,
ForceTerminationGracePeriod: in.ForceTerminationGracePeriod,
}
out.Namespace = v1alpha2.NamespaceOptions{
Name: in.Namespace,
Compiler: in.NamespaceTemplateCompiler,
Template: in.NamespaceTemplate,
}
out.Report = &v1alpha2.ReportOptions{
Format: v1alpha2.ReportFormatType(in.ReportFormat),
Path: in.ReportPath,
Name: in.ReportName,
}
out.Templating = v1alpha2.TemplatingOptions{
Enabled: in.Template,
Compiler: in.Compiler,
}
out.Timeouts = in.Timeouts
return nil
}
func autoConvert_v1alpha2_Configuration_To_v1alpha1_Configuration(in *v1alpha2.Configuration, out *v1alpha1.Configuration, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha2_ConfigurationSpec_To_v1alpha1_ConfigurationSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha2_Configuration_To_v1alpha1_Configuration is an autogenerated conversion function.
func Convert_v1alpha2_Configuration_To_v1alpha1_Configuration(in *v1alpha2.Configuration, out *v1alpha1.Configuration, s conversion.Scope) error {
return autoConvert_v1alpha2_Configuration_To_v1alpha1_Configuration(in, out, s)
}
func autoConvert_v1alpha1_Configuration_To_v1alpha2_Configuration(in *v1alpha1.Configuration, out *v1alpha2.Configuration, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha1_Configuration_To_v1alpha2_Configuration is an autogenerated conversion function.
func Convert_v1alpha1_Configuration_To_v1alpha2_Configuration(in *v1alpha1.Configuration, out *v1alpha2.Configuration, s conversion.Scope) error {
return autoConvert_v1alpha1_Configuration_To_v1alpha2_Configuration(in, out, s)
}

View File

@ -1,22 +0,0 @@
package conversion
import (
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/apis/v1alpha2"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"
)
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*v1alpha2.Configuration)(nil), (*v1alpha1.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_Configuration_To_v1alpha1_Configuration(a.(*v1alpha2.Configuration), b.(*v1alpha1.Configuration), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.Configuration)(nil), (*v1alpha2.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_Configuration_To_v1alpha2_Configuration(a.(*v1alpha1.Configuration), b.(*v1alpha2.Configuration), scope)
}); err != nil {
return err
}
return nil
}

View File

@ -20,13 +20,12 @@ type ActionCheck struct {
} }
// ActionCheckRef contains check reference options for an action. // ActionCheckRef contains check reference options for an action.
// +kubebuilder:not:={required:{file,resource}}
type ActionCheckRef struct { type ActionCheckRef struct {
FileRef `json:",inline"` FileRef `json:",inline"`
// Check provides a check used in assertions. // Check provides a check used in assertions.
// +optional // +optional
Check *Projection `json:"resource,omitempty"` Check *Check `json:"resource,omitempty"`
// Template determines whether resources should be considered for templating. // Template determines whether resources should be considered for templating.
// +optional // +optional
@ -35,9 +34,9 @@ type ActionCheckRef struct {
// ActionClusters contains clusters options for an action. // ActionClusters contains clusters options for an action.
type ActionClusters struct { type ActionClusters struct {
// Cluster defines the target cluster (will be inherited if not specified). // Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
// +optional // +optional
Cluster *string `json:"cluster,omitempty"` Cluster string `json:"cluster,omitempty"`
// Clusters holds a registry to clusters to support multi-cluster tests. // Clusters holds a registry to clusters to support multi-cluster tests.
// +optional // +optional
@ -60,10 +59,6 @@ type ActionEnv struct {
// SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise. // SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.
// +optional // +optional
SkipLogOutput bool `json:"skipLogOutput,omitempty"` SkipLogOutput bool `json:"skipLogOutput,omitempty"`
// SkipCommandOutput removes the command from the output logs.
// +optional
SkipCommandOutput bool `json:"skipCommandOutput,omitempty"`
} }
// ActionExpectations contains expectations for an action. // ActionExpectations contains expectations for an action.
@ -95,13 +90,12 @@ type ActionObject struct {
} }
// ActionObjectSelector contains object selector options for an action. // ActionObjectSelector contains object selector options for an action.
// +kubebuilder:not:={required:{name,selector}}
type ActionObjectSelector struct { type ActionObjectSelector struct {
ObjectName `json:",inline"` ObjectName `json:",inline"`
// Selector defines labels selector. // Selector defines labels selector.
// +optional // +optional
Selector Expression `json:"selector,omitempty"` Selector string `json:"selector,omitempty"`
} }
// ActionOutputs contains outputs options for an action. // ActionOutputs contains outputs options for an action.
@ -116,11 +110,10 @@ type FileRef struct {
// File is the path to the referenced file. This can be a direct path to a file // File is the path to the referenced file. This can be a direct path to a file
// or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML // or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML
// files within the "manifest" directory. // files within the "manifest" directory.
File Expression `json:"file,omitempty"` File string `json:"file,omitempty"`
} }
// ActionResourceRef contains resource reference options for an action. // ActionResourceRef contains resource reference options for an action.
// +kubebuilder:not:={required:{file,resource}}
type ActionResourceRef struct { type ActionResourceRef struct {
FileRef `json:",inline"` FileRef `json:",inline"`
// Resource provides a resource to be applied. // Resource provides a resource to be applied.
@ -178,10 +171,6 @@ type Command struct {
// Args is the command arguments. // Args is the command arguments.
// +optional // +optional
Args []string `json:"args,omitempty"` Args []string `json:"args,omitempty"`
// WorkDir is the working directory for command.
// +optional
WorkDir *string `json:"workDir,omitempty"`
} }
// Create represents a set of resources that should be created. // Create represents a set of resources that should be created.
@ -197,7 +186,6 @@ type Create struct {
} }
// Delete is a reference to an object that should be deleted // Delete is a reference to an object that should be deleted
// +kubebuilder:not:={required:{file,ref}}
type Delete struct { type Delete struct {
ActionBindings `json:",inline"` ActionBindings `json:",inline"`
ActionClusters `json:",inline"` ActionClusters `json:",inline"`
@ -212,7 +200,7 @@ type Delete struct {
// or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML // or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML
// files within the "manifest" directory. // files within the "manifest" directory.
// +optional // +optional
File Expression `json:"file,omitempty"` File string `json:"file,omitempty"`
// Ref determines objects to be deleted. // Ref determines objects to be deleted.
// +optional // +optional
@ -282,7 +270,7 @@ type PodLogs struct {
// Container in pod to get logs from else --all-containers is used. // Container in pod to get logs from else --all-containers is used.
// +optional // +optional
Container Expression `json:"container,omitempty"` Container string `json:"container,omitempty"`
// Tail is the number of last lines to collect from pods. If omitted or zero, // Tail is the number of last lines to collect from pods. If omitted or zero,
// then the default is 10 if you use a selector, or -1 (all) if you use a pod name. // then the default is 10 if you use a selector, or -1 (all) if you use a pod name.
@ -291,23 +279,6 @@ type PodLogs struct {
Tail *int `json:"tail,omitempty"` Tail *int `json:"tail,omitempty"`
} }
// Proxy defines how to get resources.
type Proxy struct {
ActionClusters `json:",inline"`
ActionOutputs `json:",inline"`
ActionTimeout `json:",inline"`
ObjectName `json:",inline"`
ObjectType `json:",inline"`
// TargetPort defines the target port to proxy the request.
// +optional
TargetPort Expression `json:"port,omitempty"`
// TargetPath defines the target path to proxy the request.
// +optional
TargetPath Expression `json:"path,omitempty"`
}
// Script describes a script to run as a part of a test step. // Script describes a script to run as a part of a test step.
type Script struct { type Script struct {
ActionBindings `json:",inline"` ActionBindings `json:",inline"`
@ -320,10 +291,6 @@ type Script struct {
// Content defines a shell script (run with "sh -c ..."). // Content defines a shell script (run with "sh -c ...").
// +optional // +optional
Content string `json:"content,omitempty"` Content string `json:"content,omitempty"`
// WorkDir is the working directory for script.
// +optional
WorkDir *string `json:"workDir,omitempty"`
} }
// Sleep represents a duration while nothing happens. // Sleep represents a duration while nothing happens.
@ -373,11 +340,11 @@ type WaitFor struct {
// WaitForCondition represents parameters for waiting on a specific condition of a resource. // WaitForCondition represents parameters for waiting on a specific condition of a resource.
type WaitForCondition struct { type WaitForCondition struct {
// Name defines the specific condition to wait for, e.g., "Available", "Ready". // Name defines the specific condition to wait for, e.g., "Available", "Ready".
Name Expression `json:"name"` Name string `json:"name"`
// Value defines the specific condition status to wait for, e.g., "True", "False". // Value defines the specific condition status to wait for, e.g., "True", "False".
// +optional // +optional
Value *Expression `json:"value,omitempty"` Value *string `json:"value,omitempty"`
} }
// WaitForDeletion represents parameters for waiting on a resource's deletion. // WaitForDeletion represents parameters for waiting on a resource's deletion.
@ -386,9 +353,8 @@ type WaitForDeletion struct{}
// WaitForJsonPath represents parameters for waiting on a json path of a resource. // WaitForJsonPath represents parameters for waiting on a json path of a resource.
type WaitForJsonPath struct { type WaitForJsonPath struct {
// Path defines the json path to wait for, e.g. '{.status.phase}'. // Path defines the json path to wait for, e.g. '{.status.phase}'.
Path Expression `json:"path"` Path string `json:"path"`
// Value defines the expected value to wait for, e.g., "Running". // Value defines the expected value to wait for, e.g., "Running".
// +optional Value string `json:"value"`
Value *Expression `json:"value,omitempty"`
} }

View File

@ -1,24 +1,11 @@
package v1alpha1 package v1alpha1
// CatchFinally defines actions to be executed in catch, finally and cleanup blocks. // CatchFinally defines actions to be executed in catch, finally and cleanup blocks.
// +kubebuilder:oneOf:={required:{command}}
// +kubebuilder:oneOf:={required:{delete}}
// +kubebuilder:oneOf:={required:{describe}}
// +kubebuilder:oneOf:={required:{events}}
// +kubebuilder:oneOf:={required:{get}}
// +kubebuilder:oneOf:={required:{podLogs}}
// +kubebuilder:oneOf:={required:{script}}
// +kubebuilder:oneOf:={required:{sleep}}
// +kubebuilder:oneOf:={required:{wait}}
type CatchFinally struct { type CatchFinally struct {
// Description contains a description of the operation. // Description contains a description of the operation.
// +optional // +optional
Description string `json:"description,omitempty"` Description string `json:"description,omitempty"`
// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
// PodLogs determines the pod logs collector to execute. // PodLogs determines the pod logs collector to execute.
// +optional // +optional
PodLogs *PodLogs `json:"podLogs,omitempty"` PodLogs *PodLogs `json:"podLogs,omitempty"`

View File

@ -25,14 +25,14 @@ func TestFinally_Bindings(t *testing.T) {
}{{ }{{
fields: fields{ fields: fields{
Command: &Command{ Command: &Command{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
fields: fields{ fields: fields{
Delete: &Delete{ Delete: &Delete{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
@ -55,7 +55,7 @@ func TestFinally_Bindings(t *testing.T) {
}, { }, {
fields: fields{ fields: fields{
Script: &Script{ Script: &Script{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
@ -107,7 +107,7 @@ func TestFinally_Outputs(t *testing.T) {
}{{ }{{
fields: fields{ fields: fields{
Command: &Command{ Command: &Command{
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}}, ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
}, },
}, },
want: 1, want: 1,
@ -134,7 +134,7 @@ func TestFinally_Outputs(t *testing.T) {
}, { }, {
fields: fields{ fields: fields{
Script: &Script{ Script: &Script{
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}}, ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
}, },
}, },
want: 1, want: 1,

View File

@ -8,6 +8,7 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true // +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster // +kubebuilder:resource:scope=Cluster
// +kubebuilder:storageversion
// Configuration is the resource that contains the configuration used to run tests. // Configuration is the resource that contains the configuration used to run tests.
type Configuration struct { type Configuration struct {
@ -25,8 +26,7 @@ type Configuration struct {
type ConfigurationSpec struct { type ConfigurationSpec struct {
// Global timeouts configuration. Applies to all tests/test steps if not overridden. // Global timeouts configuration. Applies to all tests/test steps if not overridden.
// +optional // +optional
// +kubebuilder:default:={} Timeouts Timeouts `json:"timeouts"`
Timeouts DefaultTimeouts `json:"timeouts"`
// If set, do not delete the resources after running the tests (implies SkipClusterDelete). // If set, do not delete the resources after running the tests (implies SkipClusterDelete).
// +optional // +optional
@ -34,12 +34,7 @@ type ConfigurationSpec struct {
// Template determines whether resources should be considered for templating. // Template determines whether resources should be considered for templating.
// +optional // +optional
// +kubebuilder:default:=true Template *bool `json:"template,omitempty"`
Template bool `json:"template"`
// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
// FailFast determines whether the test should stop upon encountering the first failure. // FailFast determines whether the test should stop upon encountering the first failure.
// +optional // +optional
@ -58,10 +53,10 @@ type ConfigurationSpec struct {
// +kubebuilder:default:=Background // +kubebuilder:default:=Background
DeletionPropagationPolicy metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"` DeletionPropagationPolicy metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"`
// ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION, nil) nil == no report. // ReportFormat determines test report format (JSON|XML|nil) nil == no report.
// maps to report.Type, however we don't want generated.deepcopy to have reference to it. // maps to report.Type, however we don't want generated.deepcopy to have reference to it.
// +optional // +optional
// +kubebuilder:validation:Enum:=JSON;XML;JUNIT-TEST;JUNIT-STEP;JUNIT-OPERATION; // +kubebuilder:validation:Enum:=JSON;XML;
ReportFormat ReportFormatType `json:"reportFormat,omitempty"` ReportFormat ReportFormatType `json:"reportFormat,omitempty"`
// ReportPath defines the path. // ReportPath defines the path.
@ -79,13 +74,9 @@ type ConfigurationSpec struct {
// +optional // +optional
Namespace string `json:"namespace,omitempty"` Namespace string `json:"namespace,omitempty"`
// NamespaceTemplateCompiler defines the default compiler to use when evaluating expressions.
// +optional
NamespaceTemplateCompiler *Compiler `json:"namespaceTemplateCompiler,omitempty"`
// NamespaceTemplate defines a template to create the test namespace. // NamespaceTemplate defines a template to create the test namespace.
// +optional // +optional
NamespaceTemplate *Projection `json:"namespaceTemplate,omitempty"` NamespaceTemplate *Any `json:"namespaceTemplate,omitempty"`
// FullName makes use of the full test case folder path instead of the folder name. // FullName makes use of the full test case folder path instead of the folder name.
// +optional // +optional
@ -132,10 +123,7 @@ type ConfigurationSpec struct {
type ReportFormatType string type ReportFormatType string
const ( const (
JSONFormat ReportFormatType = "JSON" JSONFormat ReportFormatType = "JSON"
XMLFormat ReportFormatType = "XML" XMLFormat ReportFormatType = "XML"
JUnitTestFormat ReportFormatType = "JUNIT-TEST" NoReport ReportFormatType = ""
JUnitStepFormat ReportFormatType = "JUNIT-STEP"
JUnitOperationFormat ReportFormatType = "JUNIT-OPERATION"
NoReport ReportFormatType = ""
) )

View File

@ -10,28 +10,9 @@ type OperationBase struct {
// Even if the test continues executing, it will still be reported as failed. // Even if the test continues executing, it will still be reported as failed.
// +optional // +optional
ContinueOnError *bool `json:"continueOnError,omitempty"` ContinueOnError *bool `json:"continueOnError,omitempty"`
// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
} }
// Operation defines a single operation, only one action is permitted for a given operation. // Operation defines a single operation, only one action is permitted for a given operation.
// +kubebuilder:oneOf:={required:{apply}}
// +kubebuilder:oneOf:={required:{assert}}
// +kubebuilder:oneOf:={required:{command}}
// +kubebuilder:oneOf:={required:{create}}
// +kubebuilder:oneOf:={required:{delete}}
// +kubebuilder:oneOf:={required:{describe}}
// +kubebuilder:oneOf:={required:{error}}
// +kubebuilder:oneOf:={required:{events}}
// +kubebuilder:oneOf:={required:{patch}}
// +kubebuilder:oneOf:={required:{podLogs}}
// +kubebuilder:oneOf:={required:{proxy}}
// +kubebuilder:oneOf:={required:{script}}
// +kubebuilder:oneOf:={required:{sleep}}
// +kubebuilder:oneOf:={required:{update}}
// +kubebuilder:oneOf:={required:{wait}}
type Operation struct { type Operation struct {
// OperationBase defines common elements to all operations. // OperationBase defines common elements to all operations.
// +optional // +optional
@ -83,10 +64,6 @@ type Operation struct {
// +optional // +optional
PodLogs *PodLogs `json:"podLogs,omitempty"` PodLogs *PodLogs `json:"podLogs,omitempty"`
// Proxy runs a proxy request.
// +optional
Proxy *Proxy `json:"proxy,omitempty"`
// Script defines a script to run. // Script defines a script to run.
// +optional // +optional
Script *Script `json:"script,omitempty"` Script *Script `json:"script,omitempty"`
@ -128,8 +105,6 @@ func (o *Operation) Bindings() []Binding {
return o.Patch.Bindings return o.Patch.Bindings
case o.PodLogs != nil: case o.PodLogs != nil:
return nil return nil
case o.Proxy != nil:
return nil
case o.Script != nil: case o.Script != nil:
return o.Script.Bindings return o.Script.Bindings
case o.Sleep != nil: case o.Sleep != nil:
@ -166,8 +141,6 @@ func (o *Operation) Outputs() []Output {
return o.Patch.Outputs return o.Patch.Outputs
case o.PodLogs != nil: case o.PodLogs != nil:
return nil return nil
case o.Proxy != nil:
return o.Proxy.Outputs
case o.Script != nil: case o.Script != nil:
return o.Script.Outputs return o.Script.Outputs
case o.Sleep != nil: case o.Sleep != nil:

View File

@ -7,110 +7,111 @@ import (
) )
func TestOperation_Bindings(t *testing.T) { func TestOperation_Bindings(t *testing.T) {
type fields struct {
Apply *Apply
Assert *Assert
Command *Command
Create *Create
Delete *Delete
Error *Error
Patch *Patch
Script *Script
Sleep *Sleep
Update *Update
Wait *Wait
}
tests := []struct { tests := []struct {
name string name string
operation Operation fields fields
want int want int
}{{ }{{
operation: Operation{ fields: fields{
Apply: &Apply{ Apply: &Apply{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Assert: &Assert{ Assert: &Assert{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Command: &Command{ Command: &Command{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Create: &Create{ Create: &Create{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Delete: &Delete{ Delete: &Delete{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Describe: &Describe{},
},
want: 0,
}, {
operation: Operation{
Error: &Error{ Error: &Error{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Events: &Events{},
},
want: 0,
}, {
operation: Operation{
Get: &Get{},
},
want: 0,
}, {
operation: Operation{
Patch: &Patch{ Patch: &Patch{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
PodLogs: &PodLogs{},
},
want: 0,
}, {
operation: Operation{
Proxy: &Proxy{},
},
want: 0,
}, {
operation: Operation{
Script: &Script{ Script: &Script{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Sleep: &Sleep{}, Sleep: &Sleep{},
}, },
}, { }, {
operation: Operation{ fields: fields{
Update: &Update{ Update: &Update{
ActionBindings: ActionBindings{Bindings: []Binding{{Name: "foo", Value: NewProjection("bar")}}}, ActionBindings: ActionBindings{Bindings: []Binding{{"foo", Any{Value: "bar"}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Wait: &Wait{}, Wait: &Wait{},
}, },
}} }}
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
got := tt.operation.Bindings() c := &Operation{
Apply: tt.fields.Apply,
Assert: tt.fields.Assert,
Command: tt.fields.Command,
Create: tt.fields.Create,
Delete: tt.fields.Delete,
Error: tt.fields.Error,
Patch: tt.fields.Patch,
Script: tt.fields.Script,
Sleep: tt.fields.Sleep,
Update: tt.fields.Update,
Wait: tt.fields.Wait,
}
got := c.Bindings()
assert.Equal(t, tt.want, len(got)) assert.Equal(t, tt.want, len(got))
}) })
} }
@ -118,96 +119,102 @@ func TestOperation_Bindings(t *testing.T) {
} }
func TestOperation_Outputs(t *testing.T) { func TestOperation_Outputs(t *testing.T) {
type fields struct {
Apply *Apply
Assert *Assert
Command *Command
Create *Create
Delete *Delete
Error *Error
Patch *Patch
Script *Script
Sleep *Sleep
Update *Update
Wait *Wait
}
tests := []struct { tests := []struct {
name string name string
operation Operation fields fields
want int want int
}{{ }{{
operation: Operation{ fields: fields{
Apply: &Apply{ Apply: &Apply{
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}}, ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Assert: &Assert{}, Assert: &Assert{},
}, },
}, { }, {
operation: Operation{ fields: fields{
Command: &Command{ Command: &Command{
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}}, ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Create: &Create{ Create: &Create{
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}}, ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Delete: &Delete{}, Delete: &Delete{},
}, },
}, { }, {
operation: Operation{ fields: fields{
Describe: &Describe{},
},
}, {
operation: Operation{
Error: &Error{}, Error: &Error{},
}, },
}, { }, {
operation: Operation{ fields: fields{
Events: &Events{},
},
}, {
operation: Operation{
Get: &Get{},
},
}, {
operation: Operation{
Patch: &Patch{ Patch: &Patch{
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}}, ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
PodLogs: &PodLogs{},
},
}, {
operation: Operation{
Proxy: &Proxy{},
},
}, {
operation: Operation{
Script: &Script{ Script: &Script{
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}}, ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Sleep: &Sleep{}, Sleep: &Sleep{},
}, },
}, { }, {
operation: Operation{ fields: fields{
Update: &Update{ Update: &Update{
ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{Name: "foo", Value: NewProjection("bar")}}}}, ActionOutputs: ActionOutputs{Outputs: []Output{{Binding: Binding{"foo", Any{Value: "bar"}}}}},
}, },
}, },
want: 1, want: 1,
}, { }, {
operation: Operation{ fields: fields{
Wait: &Wait{}, Wait: &Wait{},
}, },
}} }}
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
got := tt.operation.Outputs() c := &Operation{
Apply: tt.fields.Apply,
Assert: tt.fields.Assert,
Command: tt.fields.Command,
Create: tt.fields.Create,
Delete: tt.fields.Delete,
Error: tt.fields.Error,
Patch: tt.fields.Patch,
Script: tt.fields.Script,
Sleep: tt.fields.Sleep,
Update: tt.fields.Update,
Wait: tt.fields.Wait,
}
got := c.Outputs()
assert.Equal(t, tt.want, len(got)) assert.Equal(t, tt.want, len(got))
}) })
} }

View File

@ -1,52 +0,0 @@
package v1alpha1
import (
"encoding/json"
"github.com/kyverno/kyverno-json/pkg/utils/copy"
)
// Projection can be any type.
// +k8s:deepcopy-gen=false
// +kubebuilder:validation:XPreserveUnknownFields
// +kubebuilder:validation:Type:=""
type Projection struct {
_value any
}
func NewProjection(value any) Projection {
return Projection{
_value: value,
}
}
func (a *Projection) Value() any {
return a._value
}
func (a *Projection) MarshalJSON() ([]byte, error) {
return json.Marshal(a._value)
}
func (a *Projection) UnmarshalJSON(data []byte) error {
var v any
err := json.Unmarshal(data, &v)
if err != nil {
return err
}
a._value = v
return nil
}
func (in *Projection) DeepCopyInto(out *Projection) {
out._value = copy.DeepCopy(in._value)
}
func (in *Projection) DeepCopy() *Projection {
if in == nil {
return nil
}
out := new(Projection)
in.DeepCopyInto(out)
return out
}

View File

@ -4,79 +4,16 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:storageversion
// StepTemplate is the resource that contains a step definition.
type StepTemplate struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// Test step spec.
Spec StepTemplateSpec `json:"spec"`
}
// StepTemplateSpec defines the spec of a step template.
type StepTemplateSpec struct {
// Bindings defines additional binding key/values.
// +optional
Bindings []Binding `json:"bindings,omitempty"`
// Try defines what the step will try to execute.
// +kubebuilder:validation:MinItems:=1
Try []Operation `json:"try"`
// Catch defines what the step will execute when an error happens.
// +optional
Catch []CatchFinally `json:"catch,omitempty"`
// Finally defines what the step will execute after the step is terminated.
// +optional
Finally []CatchFinally `json:"finally,omitempty"`
// Cleanup defines what will be executed after the test is terminated.
// +optional
Cleanup []CatchFinally `json:"cleanup,omitempty"`
}
// TestStep contains the test step definition used in a test spec. // TestStep contains the test step definition used in a test spec.
// +kubebuilder:not:={required:{use},anyOf:{{required:{try}},{required:{catch}},{required:{finally}},{required:{cleanup}}}}
type TestStep struct { type TestStep struct {
// Name of the step. // Name of the step.
// +optional // +optional
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
// Use defines a reference to a step template.
Use *Use `json:"use,omitempty"`
// TestStepSpec of the step. // TestStepSpec of the step.
TestStepSpec `json:",inline"` TestStepSpec `json:",inline"`
} }
// Use defines a reference to a step template.
type Use struct {
// Template references a step template.
Template string `json:"template"`
// With defines arguments passed to the step template.
// +optional
// +kubebuilder:default:={}
With With `json:"with"`
}
// With defines arguments passed to step templates.
type With struct {
// Bindings defines additional binding key/values.
// +optional
Bindings []Binding `json:"bindings,omitempty"`
}
// TestStepSpec defines the desired state and behavior for each test step. // TestStepSpec defines the desired state and behavior for each test step.
type TestStepSpec struct { type TestStepSpec struct {
// Description contains a description of the test step. // Description contains a description of the test step.
@ -94,9 +31,9 @@ type TestStepSpec struct {
// +kubebuilder:validation:Enum:=Orphan;Background;Foreground // +kubebuilder:validation:Enum:=Orphan;Background;Foreground
DeletionPropagationPolicy *metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"` DeletionPropagationPolicy *metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"`
// Cluster defines the target cluster (will be inherited if not specified). // Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
// +optional // +optional
Cluster *string `json:"cluster,omitempty"` Cluster string `json:"cluster,omitempty"`
// Clusters holds a registry to clusters to support multi-cluster tests. // Clusters holds a registry to clusters to support multi-cluster tests.
// +optional // +optional
@ -110,17 +47,12 @@ type TestStepSpec struct {
// +optional // +optional
Template *bool `json:"template,omitempty"` Template *bool `json:"template,omitempty"`
// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
// Bindings defines additional binding key/values. // Bindings defines additional binding key/values.
// +optional // +optional
Bindings []Binding `json:"bindings,omitempty"` Bindings []Binding `json:"bindings,omitempty"`
// Try defines what the step will try to execute. // Try defines what the step will try to execute.
// +kubebuilder:validation:MinItems:=1 // +kubebuilder:validation:MinItems:=1
// +optional
Try []Operation `json:"try"` Try []Operation `json:"try"`
// Catch defines what the step will execute when an error happens. // Catch defines what the step will execute when an error happens.

View File

@ -28,17 +28,13 @@ type TestSpec struct {
// +optional // +optional
Description string `json:"description,omitempty"` Description string `json:"description,omitempty"`
// FailFast determines whether the test should stop upon encountering the first failure.
// +optional
FailFast *bool `json:"failFast,omitempty"`
// Timeouts for the test. Overrides the global timeouts set in the Configuration on a per operation basis. // Timeouts for the test. Overrides the global timeouts set in the Configuration on a per operation basis.
// +optional // +optional
Timeouts *Timeouts `json:"timeouts,omitempty"` Timeouts *Timeouts `json:"timeouts,omitempty"`
// Cluster defines the target cluster (will be inherited if not specified). // Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
// +optional // +optional
Cluster *string `json:"cluster,omitempty"` Cluster string `json:"cluster,omitempty"`
// Clusters holds a registry to clusters to support multi-cluster tests. // Clusters holds a registry to clusters to support multi-cluster tests.
// +optional // +optional
@ -60,21 +56,13 @@ type TestSpec struct {
// +optional // +optional
Template *bool `json:"template,omitempty"` Template *bool `json:"template,omitempty"`
// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
// Namespace determines whether the test should run in a random ephemeral namespace or not. // Namespace determines whether the test should run in a random ephemeral namespace or not.
// +optional // +optional
Namespace string `json:"namespace,omitempty"` Namespace string `json:"namespace,omitempty"`
// NamespaceTemplate defines a template to create the test namespace. // NamespaceTemplate defines a template to create the test namespace.
// +optional // +optional
NamespaceTemplate *Projection `json:"namespaceTemplate,omitempty"` NamespaceTemplate *Any `json:"namespaceTemplate,omitempty"`
// NamespaceTemplateCompiler defines the default compiler to use when evaluating expressions.
// +optional
NamespaceTemplateCompiler *Compiler `json:"namespaceTemplateCompiler,omitempty"`
// Scenarios defines test scenarios. // Scenarios defines test scenarios.
// +optional // +optional

View File

@ -1,57 +1,40 @@
package v1alpha1 package v1alpha1
import ( import (
"context"
"encoding/json"
"fmt" "fmt"
"regexp" "regexp"
"time"
"github.com/jmespath-community/go-jmespath/pkg/parsing"
"github.com/kyverno/chainsaw/pkg/apis"
"github.com/kyverno/chainsaw/pkg/expressions"
"github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
"github.com/kyverno/kyverno-json/pkg/core/compilers"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )
const ( var identifier = regexp.MustCompile(`^(?:\w+|\(.+\))$`)
EngineJP = v1alpha1.EngineJP
EngineCEL = v1alpha1.EngineCEL
)
var ( // Any represents any type.
identifier = regexp.MustCompile(`^(?:\w+|\(.+\))$`) type Any = v1alpha1.Any
NewAny = v1alpha1.NewAny
NewCheck = v1alpha1.NewAssertionTree
NewMatch = v1alpha1.NewAssertionTree
)
type Compiler = v1alpha1.Compiler
// Binding represents a key/value set as a binding in an executing test. // Binding represents a key/value set as a binding in an executing test.
type Binding struct { type Binding struct {
// Name the name of the binding. // Name the name of the binding.
// +kubebuilder:validation:Type:=string // +kubebuilder:validation:Pattern=`^(?:\w+|\(.+\))$`
// +kubebuilder:validation:Pattern:=`^(?:\w+|\(.+\))$` Name string `json:"name"`
Name Expression `json:"name"`
// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
// Value value of the binding. // Value value of the binding.
Value Projection `json:"value"` // +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Value Any `json:"value"`
} }
func (b Binding) CheckName() error { func (b Binding) CheckName() error {
if !identifier.MatchString(string(b.Name)) { if !identifier.MatchString(b.Name) {
return fmt.Errorf("invalid name %s", b.Name) return fmt.Errorf("invalid name %s", b.Name)
} }
return nil return nil
} }
// Check represents a check to be applied on the result of an operation. // Check represents a check to be applied on the result of an operation.
type Check = v1alpha1.AssertionTree type Check = Any
// Cluster defines cluster config and context. // Cluster defines cluster config and context.
type Cluster struct { type Cluster struct {
@ -77,60 +60,24 @@ type Expectation struct {
Check Check `json:"check"` Check Check `json:"check"`
} }
// Expression defines an expression to be used in string fields.
type Expression string
func (e *Expression) MarshalJSON() ([]byte, error) {
if e == nil {
return nil, nil
}
return json.Marshal(string(*e))
}
func (e *Expression) UnmarshalJSON(data []byte) error {
var statement string
err := json.Unmarshal(data, &statement)
if err != nil {
return err
}
*e = Expression(statement)
expression := expressions.Parse(context.TODO(), statement)
if expression == nil {
return nil
}
if expression.Engine == "" {
return nil
}
parser := parsing.NewParser()
if _, err := parser.Parse(statement); err != nil {
return err
}
return nil
}
func (e Expression) Value(ctx context.Context, compilers compilers.Compilers, bindings apis.Bindings) (string, error) {
return expressions.String(ctx, compilers, string(e), bindings)
}
// Format determines the output format (json or yaml). // Format determines the output format (json or yaml).
// +kubebuilder:validation:Type:=string // +kubebuilder:validation:Pattern=`^(?:json|yaml|\(.+\))$`
// +kubebuilder:validation:Pattern:=`^(?:json|yaml|\(.+\))$` type Format string
type Format Expression
// Match represents a match condition against an evaluated object. // Match represents a match condition against an evaluated object.
type Match = v1alpha1.AssertionTree type Match = Any
// ObjectName represents an object namespace and name. // ObjectName represents an object namespace and name.
type ObjectName struct { type ObjectName struct {
// Namespace of the referent. // Namespace of the referent.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
// +optional // +optional
Namespace Expression `json:"namespace,omitempty"` Namespace string `json:"namespace,omitempty"`
// Name of the referent. // Name of the referent.
// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
// +optional // +optional
Name Expression `json:"name,omitempty"` Name string `json:"name,omitempty"`
} }
// ObjectReference represents one or more objects with a specific apiVersion and kind. // ObjectReference represents one or more objects with a specific apiVersion and kind.
@ -148,11 +95,11 @@ type ObjectReference struct {
// ObjectType represents a specific apiVersion and kind. // ObjectType represents a specific apiVersion and kind.
type ObjectType struct { type ObjectType struct {
// API version of the referent. // API version of the referent.
APIVersion Expression `json:"apiVersion"` APIVersion string `json:"apiVersion"`
// Kind of the referent. // Kind of the referent.
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Kind Expression `json:"kind"` Kind string `json:"kind"`
} }
// Output represents an output binding with a match to determine if the binding must be considered or not. // Output represents an output binding with a match to determine if the binding must be considered or not.
@ -165,38 +112,14 @@ type Output struct {
Match *Match `json:"match,omitempty"` Match *Match `json:"match,omitempty"`
} }
// DefaultTimeouts contains defautl timeouts per operation. const (
type DefaultTimeouts struct { DefaultApplyTimeout = 5 * time.Second
// Apply defines the timeout for the apply operation DefaultAssertTimeout = 30 * time.Second
// +optional DefaultCleanupTimeout = 30 * time.Second
// +kubebuilder:default:="5s" DefaultDeleteTimeout = 15 * time.Second
Apply metav1.Duration `json:"apply"` DefaultErrorTimeout = 30 * time.Second
DefaultExecTimeout = 5 * time.Second
// Assert defines the timeout for the assert operation )
// +optional
// +kubebuilder:default:="30s"
Assert metav1.Duration `json:"assert"`
// Cleanup defines the timeout for the cleanup operation
// +optional
// +kubebuilder:default:="30s"
Cleanup metav1.Duration `json:"cleanup"`
// Delete defines the timeout for the delete operation
// +optional
// +kubebuilder:default:="15s"
Delete metav1.Duration `json:"delete"`
// Error defines the timeout for the error operation
// +optional
// +kubebuilder:default:="30s"
Error metav1.Duration `json:"error"`
// Exec defines the timeout for exec operations
// +optional
// +kubebuilder:default:="5s"
Exec metav1.Duration `json:"exec"`
}
// Timeouts contains timeouts per operation. // Timeouts contains timeouts per operation.
type Timeouts struct { type Timeouts struct {
@ -218,3 +141,59 @@ type Timeouts struct {
// Exec defines the timeout for exec operations // Exec defines the timeout for exec operations
Exec *metav1.Duration `json:"exec,omitempty"` Exec *metav1.Duration `json:"exec,omitempty"`
} }
func durationOrDefault(to *metav1.Duration, def time.Duration) time.Duration {
if to != nil {
return to.Duration
}
return def
}
func (t Timeouts) ApplyDuration() time.Duration {
return durationOrDefault(t.Apply, DefaultApplyTimeout)
}
func (t Timeouts) AssertDuration() time.Duration {
return durationOrDefault(t.Assert, DefaultAssertTimeout)
}
func (t Timeouts) CleanupDuration() time.Duration {
return durationOrDefault(t.Cleanup, DefaultCleanupTimeout)
}
func (t Timeouts) DeleteDuration() time.Duration {
return durationOrDefault(t.Delete, DefaultDeleteTimeout)
}
func (t Timeouts) ErrorDuration() time.Duration {
return durationOrDefault(t.Error, DefaultErrorTimeout)
}
func (t Timeouts) ExecDuration() time.Duration {
return durationOrDefault(t.Exec, DefaultExecTimeout)
}
func (t Timeouts) Combine(override *Timeouts) Timeouts {
if override == nil {
return t
}
if override.Apply != nil {
t.Apply = override.Apply
}
if override.Assert != nil {
t.Assert = override.Assert
}
if override.Error != nil {
t.Error = override.Error
}
if override.Delete != nil {
t.Delete = override.Delete
}
if override.Cleanup != nil {
t.Cleanup = override.Cleanup
}
if override.Exec != nil {
t.Exec = override.Exec
}
return t
}

View File

@ -2,15 +2,17 @@ package v1alpha1
import ( import (
"testing" "testing"
"time"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )
func TestBinding_CheckName(t *testing.T) { func TestBinding_CheckName(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
bindingName Expression bindingName string
bindingValue Projection bindingValue Any
wantErr bool wantErr bool
}{{ }{{
name: "empty", name: "empty",
@ -55,3 +57,97 @@ func TestBinding_CheckName(t *testing.T) {
}) })
} }
} }
func Test_durationOrDefault(t *testing.T) {
tests := []struct {
name string
to *metav1.Duration
def time.Duration
want time.Duration
}{{
name: "nil",
to: nil,
def: time.Second * 3,
want: time.Second * 3,
}, {
name: "not nil",
to: &metav1.Duration{Duration: time.Second * 2},
def: time.Second * 3,
want: time.Second * 2,
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := durationOrDefault(tt.to, tt.def)
assert.Equal(t, tt.want, got)
})
}
}
func TestTimeouts_Defaults(t *testing.T) {
var timeouts Timeouts
assert.Equal(t, DefaultApplyTimeout, timeouts.ApplyDuration())
assert.Equal(t, DefaultAssertTimeout, timeouts.AssertDuration())
assert.Equal(t, DefaultCleanupTimeout, timeouts.CleanupDuration())
assert.Equal(t, DefaultDeleteTimeout, timeouts.DeleteDuration())
assert.Equal(t, DefaultErrorTimeout, timeouts.ErrorDuration())
assert.Equal(t, DefaultExecTimeout, timeouts.ExecDuration())
}
func TestTimeouts_NoyDefaults(t *testing.T) {
to := &metav1.Duration{Duration: time.Hour * 2}
timeouts := Timeouts{
Apply: to,
Assert: to,
Cleanup: to,
Delete: to,
Error: to,
Exec: to,
}
assert.Equal(t, time.Hour*2, timeouts.ApplyDuration())
assert.Equal(t, time.Hour*2, timeouts.AssertDuration())
assert.Equal(t, time.Hour*2, timeouts.CleanupDuration())
assert.Equal(t, time.Hour*2, timeouts.DeleteDuration())
assert.Equal(t, time.Hour*2, timeouts.ErrorDuration())
assert.Equal(t, time.Hour*2, timeouts.ExecDuration())
}
func TestTimeouts_Combine(t *testing.T) {
base := Timeouts{
Apply: &metav1.Duration{Duration: 1 * time.Minute},
Assert: &metav1.Duration{Duration: 1 * time.Minute},
Cleanup: &metav1.Duration{Duration: 1 * time.Minute},
Delete: &metav1.Duration{Duration: 1 * time.Minute},
Error: &metav1.Duration{Duration: 1 * time.Minute},
Exec: &metav1.Duration{Duration: 1 * time.Minute},
}
override := Timeouts{
Apply: &metav1.Duration{Duration: 2 * time.Minute},
Assert: &metav1.Duration{Duration: 2 * time.Minute},
Cleanup: &metav1.Duration{Duration: 2 * time.Minute},
Delete: &metav1.Duration{Duration: 2 * time.Minute},
Error: &metav1.Duration{Duration: 2 * time.Minute},
Exec: &metav1.Duration{Duration: 2 * time.Minute},
}
tests := []struct {
name string
base Timeouts
override *Timeouts
want Timeouts
}{{
name: "nil",
base: base,
override: nil,
want: base,
}, {
name: "override",
base: base,
override: &override,
want: override,
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := tt.base.Combine(tt.override)
assert.Equal(t, tt.want, got)
})
}
}

View File

@ -22,7 +22,6 @@ limitations under the License.
package v1alpha1 package v1alpha1
import ( import (
policyv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
) )
@ -99,11 +98,6 @@ func (in *ActionCheckRef) DeepCopy() *ActionCheckRef {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ActionClusters) DeepCopyInto(out *ActionClusters) { func (in *ActionClusters) DeepCopyInto(out *ActionClusters) {
*out = *in *out = *in
if in.Cluster != nil {
in, out := &in.Cluster, &out.Cluster
*out = new(string)
**out = **in
}
if in.Clusters != nil { if in.Clusters != nil {
in, out := &in.Clusters, &out.Clusters in, out := &in.Clusters, &out.Clusters
*out = make(Clusters, len(*in)) *out = make(Clusters, len(*in))
@ -378,11 +372,6 @@ func (in *Assert) DeepCopy() *Assert {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Binding) DeepCopyInto(out *Binding) { func (in *Binding) DeepCopyInto(out *Binding) {
*out = *in *out = *in
if in.Compiler != nil {
in, out := &in.Compiler, &out.Compiler
*out = new(policyv1alpha1.Compiler)
**out = **in
}
in.Value.DeepCopyInto(&out.Value) in.Value.DeepCopyInto(&out.Value)
return return
} }
@ -400,11 +389,6 @@ func (in *Binding) DeepCopy() *Binding {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CatchFinally) DeepCopyInto(out *CatchFinally) { func (in *CatchFinally) DeepCopyInto(out *CatchFinally) {
*out = *in *out = *in
if in.Compiler != nil {
in, out := &in.Compiler, &out.Compiler
*out = new(policyv1alpha1.Compiler)
**out = **in
}
if in.PodLogs != nil { if in.PodLogs != nil {
in, out := &in.PodLogs, &out.PodLogs in, out := &in.PodLogs, &out.PodLogs
*out = new(PodLogs) *out = new(PodLogs)
@ -515,11 +499,6 @@ func (in *Command) DeepCopyInto(out *Command) {
*out = make([]string, len(*in)) *out = make([]string, len(*in))
copy(*out, *in) copy(*out, *in)
} }
if in.WorkDir != nil {
in, out := &in.WorkDir, &out.WorkDir
*out = new(string)
**out = **in
}
return return
} }
@ -563,10 +542,10 @@ func (in *Configuration) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) { func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) {
*out = *in *out = *in
out.Timeouts = in.Timeouts in.Timeouts.DeepCopyInto(&out.Timeouts)
if in.Compiler != nil { if in.Template != nil {
in, out := &in.Compiler, &out.Compiler in, out := &in.Template, &out.Template
*out = new(policyv1alpha1.Compiler) *out = new(bool)
**out = **in **out = **in
} }
if in.Parallel != nil { if in.Parallel != nil {
@ -574,11 +553,6 @@ func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) {
*out = new(int) *out = new(int)
**out = **in **out = **in
} }
if in.NamespaceTemplateCompiler != nil {
in, out := &in.NamespaceTemplateCompiler, &out.NamespaceTemplateCompiler
*out = new(policyv1alpha1.Compiler)
**out = **in
}
if in.NamespaceTemplate != nil { if in.NamespaceTemplate != nil {
in, out := &in.NamespaceTemplate, &out.NamespaceTemplate in, out := &in.NamespaceTemplate, &out.NamespaceTemplate
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
@ -648,28 +622,6 @@ func (in *Create) DeepCopy() *Create {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DefaultTimeouts) DeepCopyInto(out *DefaultTimeouts) {
*out = *in
out.Apply = in.Apply
out.Assert = in.Assert
out.Cleanup = in.Cleanup
out.Delete = in.Delete
out.Error = in.Error
out.Exec = in.Exec
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultTimeouts.
func (in *DefaultTimeouts) DeepCopy() *DefaultTimeouts {
if in == nil {
return nil
}
out := new(DefaultTimeouts)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Delete) DeepCopyInto(out *Delete) { func (in *Delete) DeepCopyInto(out *Delete) {
*out = *in *out = *in
@ -942,11 +894,6 @@ func (in *Operation) DeepCopyInto(out *Operation) {
*out = new(PodLogs) *out = new(PodLogs)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
if in.Proxy != nil {
in, out := &in.Proxy, &out.Proxy
*out = new(Proxy)
(*in).DeepCopyInto(*out)
}
if in.Script != nil { if in.Script != nil {
in, out := &in.Script, &out.Script in, out := &in.Script, &out.Script
*out = new(Script) *out = new(Script)
@ -988,11 +935,6 @@ func (in *OperationBase) DeepCopyInto(out *OperationBase) {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
if in.Compiler != nil {
in, out := &in.Compiler, &out.Compiler
*out = new(policyv1alpha1.Compiler)
**out = **in
}
return return
} }
@ -1074,27 +1016,6 @@ func (in *PodLogs) DeepCopy() *PodLogs {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Proxy) DeepCopyInto(out *Proxy) {
*out = *in
in.ActionClusters.DeepCopyInto(&out.ActionClusters)
in.ActionOutputs.DeepCopyInto(&out.ActionOutputs)
in.ActionTimeout.DeepCopyInto(&out.ActionTimeout)
out.ObjectName = in.ObjectName
out.ObjectType = in.ObjectType
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Proxy.
func (in *Proxy) DeepCopy() *Proxy {
if in == nil {
return nil
}
out := new(Proxy)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Scenario) DeepCopyInto(out *Scenario) { func (in *Scenario) DeepCopyInto(out *Scenario) {
*out = *in *out = *in
@ -1127,11 +1048,6 @@ func (in *Script) DeepCopyInto(out *Script) {
in.ActionEnv.DeepCopyInto(&out.ActionEnv) in.ActionEnv.DeepCopyInto(&out.ActionEnv)
in.ActionOutputs.DeepCopyInto(&out.ActionOutputs) in.ActionOutputs.DeepCopyInto(&out.ActionOutputs)
in.ActionTimeout.DeepCopyInto(&out.ActionTimeout) in.ActionTimeout.DeepCopyInto(&out.ActionTimeout)
if in.WorkDir != nil {
in, out := &in.WorkDir, &out.WorkDir
*out = new(string)
**out = **in
}
return return
} }
@ -1162,84 +1078,6 @@ func (in *Sleep) DeepCopy() *Sleep {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StepTemplate) DeepCopyInto(out *StepTemplate) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepTemplate.
func (in *StepTemplate) DeepCopy() *StepTemplate {
if in == nil {
return nil
}
out := new(StepTemplate)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *StepTemplate) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StepTemplateSpec) DeepCopyInto(out *StepTemplateSpec) {
*out = *in
if in.Bindings != nil {
in, out := &in.Bindings, &out.Bindings
*out = make([]Binding, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Try != nil {
in, out := &in.Try, &out.Try
*out = make([]Operation, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Catch != nil {
in, out := &in.Catch, &out.Catch
*out = make([]CatchFinally, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Finally != nil {
in, out := &in.Finally, &out.Finally
*out = make([]CatchFinally, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Cleanup != nil {
in, out := &in.Cleanup, &out.Cleanup
*out = make([]CatchFinally, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepTemplateSpec.
func (in *StepTemplateSpec) DeepCopy() *StepTemplateSpec {
if in == nil {
return nil
}
out := new(StepTemplateSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Test) DeepCopyInto(out *Test) { func (in *Test) DeepCopyInto(out *Test) {
*out = *in *out = *in
@ -1270,21 +1108,11 @@ func (in *Test) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TestSpec) DeepCopyInto(out *TestSpec) { func (in *TestSpec) DeepCopyInto(out *TestSpec) {
*out = *in *out = *in
if in.FailFast != nil {
in, out := &in.FailFast, &out.FailFast
*out = new(bool)
**out = **in
}
if in.Timeouts != nil { if in.Timeouts != nil {
in, out := &in.Timeouts, &out.Timeouts in, out := &in.Timeouts, &out.Timeouts
*out = new(Timeouts) *out = new(Timeouts)
(*in).DeepCopyInto(*out) (*in).DeepCopyInto(*out)
} }
if in.Cluster != nil {
in, out := &in.Cluster, &out.Cluster
*out = new(string)
**out = **in
}
if in.Clusters != nil { if in.Clusters != nil {
in, out := &in.Clusters, &out.Clusters in, out := &in.Clusters, &out.Clusters
*out = make(Clusters, len(*in)) *out = make(Clusters, len(*in))
@ -1312,20 +1140,10 @@ func (in *TestSpec) DeepCopyInto(out *TestSpec) {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
if in.Compiler != nil {
in, out := &in.Compiler, &out.Compiler
*out = new(policyv1alpha1.Compiler)
**out = **in
}
if in.NamespaceTemplate != nil { if in.NamespaceTemplate != nil {
in, out := &in.NamespaceTemplate, &out.NamespaceTemplate in, out := &in.NamespaceTemplate, &out.NamespaceTemplate
*out = (*in).DeepCopy() *out = (*in).DeepCopy()
} }
if in.NamespaceTemplateCompiler != nil {
in, out := &in.NamespaceTemplateCompiler, &out.NamespaceTemplateCompiler
*out = new(policyv1alpha1.Compiler)
**out = **in
}
if in.Scenarios != nil { if in.Scenarios != nil {
in, out := &in.Scenarios, &out.Scenarios in, out := &in.Scenarios, &out.Scenarios
*out = make([]Scenario, len(*in)) *out = make([]Scenario, len(*in))
@ -1385,11 +1203,6 @@ func (in *TestSpec) DeepCopy() *TestSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TestStep) DeepCopyInto(out *TestStep) { func (in *TestStep) DeepCopyInto(out *TestStep) {
*out = *in *out = *in
if in.Use != nil {
in, out := &in.Use, &out.Use
*out = new(Use)
(*in).DeepCopyInto(*out)
}
in.TestStepSpec.DeepCopyInto(&out.TestStepSpec) in.TestStepSpec.DeepCopyInto(&out.TestStepSpec)
return return
} }
@ -1417,11 +1230,6 @@ func (in *TestStepSpec) DeepCopyInto(out *TestStepSpec) {
*out = new(v1.DeletionPropagation) *out = new(v1.DeletionPropagation)
**out = **in **out = **in
} }
if in.Cluster != nil {
in, out := &in.Cluster, &out.Cluster
*out = new(string)
**out = **in
}
if in.Clusters != nil { if in.Clusters != nil {
in, out := &in.Clusters, &out.Clusters in, out := &in.Clusters, &out.Clusters
*out = make(Clusters, len(*in)) *out = make(Clusters, len(*in))
@ -1439,11 +1247,6 @@ func (in *TestStepSpec) DeepCopyInto(out *TestStepSpec) {
*out = new(bool) *out = new(bool)
**out = **in **out = **in
} }
if in.Compiler != nil {
in, out := &in.Compiler, &out.Compiler
*out = new(policyv1alpha1.Compiler)
**out = **in
}
if in.Bindings != nil { if in.Bindings != nil {
in, out := &in.Bindings, &out.Bindings in, out := &in.Bindings, &out.Bindings
*out = make([]Binding, len(*in)) *out = make([]Binding, len(*in))
@ -1561,23 +1364,6 @@ func (in *Update) DeepCopy() *Update {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Use) DeepCopyInto(out *Use) {
*out = *in
in.With.DeepCopyInto(&out.With)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Use.
func (in *Use) DeepCopy() *Use {
if in == nil {
return nil
}
out := new(Use)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Wait) DeepCopyInto(out *Wait) { func (in *Wait) DeepCopyInto(out *Wait) {
*out = *in *out = *in
@ -1615,7 +1401,7 @@ func (in *WaitFor) DeepCopyInto(out *WaitFor) {
if in.JsonPath != nil { if in.JsonPath != nil {
in, out := &in.JsonPath, &out.JsonPath in, out := &in.JsonPath, &out.JsonPath
*out = new(WaitForJsonPath) *out = new(WaitForJsonPath)
(*in).DeepCopyInto(*out) **out = **in
} }
return return
} }
@ -1635,7 +1421,7 @@ func (in *WaitForCondition) DeepCopyInto(out *WaitForCondition) {
*out = *in *out = *in
if in.Value != nil { if in.Value != nil {
in, out := &in.Value, &out.Value in, out := &in.Value, &out.Value
*out = new(Expression) *out = new(string)
**out = **in **out = **in
} }
return return
@ -1670,11 +1456,6 @@ func (in *WaitForDeletion) DeepCopy() *WaitForDeletion {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WaitForJsonPath) DeepCopyInto(out *WaitForJsonPath) { func (in *WaitForJsonPath) DeepCopyInto(out *WaitForJsonPath) {
*out = *in *out = *in
if in.Value != nil {
in, out := &in.Value, &out.Value
*out = new(Expression)
**out = **in
}
return return
} }
@ -1687,26 +1468,3 @@ func (in *WaitForJsonPath) DeepCopy() *WaitForJsonPath {
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *With) DeepCopyInto(out *With) {
*out = *in
if in.Bindings != nil {
in, out := &in.Bindings, &out.Bindings
*out = make([]Binding, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new With.
func (in *With) DeepCopy() *With {
if in == nil {
return nil
}
out := new(With)
in.DeepCopyInto(out)
return out
}

View File

@ -1,6 +1,3 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/* /*
Copyright The Kubernetes Authors. Copyright The Kubernetes Authors.
@ -23,8 +20,8 @@ package v1alpha1
import ( import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
// GroupName specifies the group name used to register the objects. // GroupName specifies the group name used to register the objects.
@ -46,7 +43,7 @@ var (
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder runtime.SchemeBuilder SchemeBuilder runtime.SchemeBuilder
localSchemeBuilder = &SchemeBuilder localSchemeBuilder = &SchemeBuilder
// Deprecated: use Install instead // Depreciated: use Install instead
AddToScheme = localSchemeBuilder.AddToScheme AddToScheme = localSchemeBuilder.AddToScheme
Install = localSchemeBuilder.AddToScheme Install = localSchemeBuilder.AddToScheme
) )
@ -62,7 +59,6 @@ func init() {
func addKnownTypes(scheme *runtime.Scheme) error { func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion, scheme.AddKnownTypes(SchemeGroupVersion,
&Configuration{}, &Configuration{},
&StepTemplate{},
&Test{}, &Test{},
) )
// AddToGroupVersion allows the serialization of client types like ListOptions. // AddToGroupVersion allows the serialization of client types like ListOptions.

325
pkg/apis/v1alpha2/action.go Normal file
View File

@ -0,0 +1,325 @@
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
// ActionCheck contains check for an action.
type ActionCheck struct {
// Check is an assertion tree to validate the operation outcome.
// +optional
Check *Check `json:"check,omitempty"`
}
// ActionCheckRef contains check reference options for an action.
type ActionCheckRef struct {
FileRef `json:",inline"`
// Check provides a check used in assertions.
// +optional
Check *Check `json:"resource,omitempty"`
// Template determines whether resources should be considered for templating.
// +optional
Template *bool `json:"template,omitempty"`
}
// ActionDryRun contains dry run options for an action.
type ActionDryRun struct {
// DryRun determines whether the file should be applied in dry run mode.
// +optional
DryRun *bool `json:"dryRun,omitempty"`
}
// ActionEnv contains environment options for an action.
type ActionEnv struct {
// Env defines additional environment variables.
// +optional
Env []Binding `json:"env,omitempty"`
// SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise.
// +optional
SkipLogOutput bool `json:"skipLogOutput,omitempty"`
}
// ActionExpectations contains expectations for an action.
type ActionExpectations struct {
// Expect defines a list of matched checks to validate the operation outcome.
// +optional
Expect []Expectation `json:"expect,omitempty"`
}
// ActionFormat contains format for an action.
type ActionFormat struct {
// Format determines the output format (json or yaml).
// +optional
Format Format `json:"format,omitempty"`
}
type ActionInlineResource struct {
// Resource provides a resource to be applied.
// +kubebuilder:validation:XEmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
// +optional
Resource *unstructured.Unstructured `json:"resource,omitempty"`
}
// ActionObject contains object selector options for an action.
type ActionObject struct {
ObjectType `json:",inline"`
ActionObjectSelector `json:",inline"`
}
// ActionObjectSelector contains object selector options for an action.
type ActionObjectSelector struct {
ObjectName `json:",inline"`
// Selector defines labels selector.
// +optional
Selector string `json:"selector,omitempty"`
}
// FileRef represents a file reference.
type FileRef struct {
// File is the path to the referenced file. This can be a direct path to a file
// or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML
// files within the "manifest" directory.
File string `json:"file,omitempty"`
}
// ActionResourceRef contains resource reference options for an action.
type ActionResourceRef struct {
FileRef `json:",inline"`
// Resource provides a resource to be applied.
// +kubebuilder:validation:XEmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
// +optional
Resource *unstructured.Unstructured `json:"resource,omitempty"`
// ActionInlineResource `json:",inline"`
// Template determines whether resources should be considered for templating.
// +optional
Template *bool `json:"template,omitempty"`
}
// ActionTimeout contains timeout options for an action.
type ActionTimeout struct {
// Timeout for the operation. Overrides the global timeout set in the Configuration.
// +optional
Timeout *metav1.Duration `json:"timeout,omitempty"`
}
// Apply represents a set of configurations or resources that
// should be applied during testing.
// +k8s:conversion-gen=false
type Apply struct {
ActionDryRun `json:",inline"`
ActionExpectations `json:",inline"`
ActionResourceRef `json:",inline"`
ActionTimeout `json:",inline"`
}
// Assert represents a test condition that is expected to hold true
// during the testing process.
// +k8s:conversion-gen=false
type Assert struct {
ActionCheckRef `json:",inline"`
ActionTimeout `json:",inline"`
}
// Command describes a command to run as a part of a test step.
// +k8s:conversion-gen=false
type Command struct {
ActionCheck `json:",inline"`
ActionEnv `json:",inline"`
ActionTimeout `json:",inline"`
// Entrypoint is the command entry point to run.
Entrypoint string `json:"entrypoint"`
// Args is the command arguments.
// +optional
Args []string `json:"args,omitempty"`
}
// Create represents a set of resources that should be created.
// If a resource already exists in the cluster it will fail.
// +k8s:conversion-gen=false
type Create struct {
ActionDryRun `json:",inline"`
ActionExpectations `json:",inline"`
ActionResourceRef `json:",inline"`
ActionTimeout `json:",inline"`
}
// Delete is a reference to an object that should be deleted
// +k8s:conversion-gen=false
type Delete struct {
ActionExpectations `json:",inline"`
ActionTimeout `json:",inline"`
// Template determines whether resources should be considered for templating.
// +optional
Template *bool `json:"template,omitempty"`
// File is the path to the referenced file. This can be a direct path to a file
// or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML
// files within the "manifest" directory.
// +optional
File string `json:"file,omitempty"`
// Ref determines objects to be deleted.
// +optional
Ref *ObjectReference `json:"ref,omitempty"`
// DeletionPropagationPolicy decides if a deletion will propagate to the dependents of
// the object, and how the garbage collector will handle the propagation.
// Overrides the deletion propagation policy set in the Configuration, the Test and the TestStep.
// +optional
// +kubebuilder:validation:Enum:=Orphan;Background;Foreground
DeletionPropagationPolicy *metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"`
}
// Describe defines how to describe resources.
// +k8s:conversion-gen=false
type Describe struct {
ActionObject `json:",inline"`
ActionTimeout `json:",inline"`
// Show Events indicates whether to include related events.
// +optional
ShowEvents *bool `json:"showEvents,omitempty"`
}
// Error represents an anticipated error condition that may arise during testing.
// Instead of treating such an error as a test failure, it acknowledges it as expected.
// +k8s:conversion-gen=false
type Error struct {
ActionCheckRef `json:",inline"`
ActionTimeout `json:",inline"`
}
// Events defines how to collect events.
// +k8s:conversion-gen=false
type Events struct {
ActionFormat `json:",inline"`
ActionObjectSelector `json:",inline"`
ActionTimeout `json:",inline"`
}
// Get defines how to get resources.
// +k8s:conversion-gen=false
type Get struct {
ActionFormat `json:",inline"`
ActionObject `json:",inline"`
ActionTimeout `json:",inline"`
}
// Patch represents a set of resources that should be patched.
// If a resource doesn't exist yet in the cluster it will fail.
// +k8s:conversion-gen=false
type Patch struct {
ActionDryRun `json:",inline"`
ActionExpectations `json:",inline"`
ActionResourceRef `json:",inline"`
ActionTimeout `json:",inline"`
}
// PodLogs defines how to collect pod logs.
// +k8s:conversion-gen=false
type PodLogs struct {
ActionObjectSelector `json:",inline"`
ActionTimeout `json:",inline"`
// Container in pod to get logs from else --all-containers is used.
// +optional
Container string `json:"container,omitempty"`
// Tail is the number of last lines to collect from pods. If omitted or zero,
// then the default is 10 if you use a selector, or -1 (all) if you use a pod name.
// This matches default behavior of `kubectl logs`.
// +optional
Tail *int `json:"tail,omitempty"`
}
// Script describes a script to run as a part of a test step.
// +k8s:conversion-gen=false
type Script struct {
ActionCheck `json:",inline"`
ActionEnv `json:",inline"`
ActionTimeout `json:",inline"`
// Content defines a shell script (run with "sh -c ...").
// +optional
Content string `json:"content,omitempty"`
}
// Sleep represents a duration while nothing happens.
// +k8s:conversion-gen=false
type Sleep struct {
// Duration is the delay used for sleeping.
Duration metav1.Duration `json:"duration"`
}
// Update represents a set of resources that should be updated.
// If a resource does not exist in the cluster it will fail.
// +k8s:conversion-gen=false
type Update struct {
ActionDryRun `json:",inline"`
ActionExpectations `json:",inline"`
ActionResourceRef `json:",inline"`
ActionTimeout `json:",inline"`
}
// Wait specifies how to perform wait operations on resources.
// +k8s:conversion-gen=false
type Wait struct {
ActionTimeout `json:",inline"`
ActionFormat `json:",inline"`
ActionObject `json:",inline"`
// WaitFor specifies the condition to wait for.
WaitFor `json:"for"`
}
// WaitFor specifies the condition to wait for.
// +k8s:conversion-gen=false
type WaitFor struct {
// Deletion specifies parameters for waiting on a resource's deletion.
// +optional
Deletion *WaitForDeletion `json:"deletion,omitempty"`
// Condition specifies the condition to wait for.
// +optional
Condition *WaitForCondition `json:"condition,omitempty"`
// JsonPath specifies the json path condition to wait for.
// +optional
JsonPath *WaitForJsonPath `json:"jsonPath,omitempty"`
}
// WaitForCondition represents parameters for waiting on a specific condition of a resource.
// +k8s:conversion-gen=false
type WaitForCondition struct {
// Name defines the specific condition to wait for, e.g., "Available", "Ready".
Name string `json:"name"`
// Value defines the specific condition status to wait for, e.g., "True", "False".
// +optional
Value *string `json:"value,omitempty"`
}
// WaitForDeletion represents parameters for waiting on a resource's deletion.
// +k8s:conversion-gen=false
type WaitForDeletion struct{}
// WaitForJsonPath represents parameters for waiting on a json path of a resource.
// +k8s:conversion-gen=false
type WaitForJsonPath struct {
// Path defines the json path to wait for, e.g. '{.status.phase}'.
Path string `json:"path"`
// Value defines the expected value to wait for, e.g., "Running".
Value string `json:"value"`
}

View File

@ -8,7 +8,6 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true // +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster // +kubebuilder:resource:scope=Cluster
// +kubebuilder:storageversion
// Configuration is the resource that contains the configuration used to run tests. // Configuration is the resource that contains the configuration used to run tests.
type Configuration struct { type Configuration struct {
@ -27,12 +26,11 @@ type Configuration struct {
type ConfigurationSpec struct { type ConfigurationSpec struct {
// Cleanup contains cleanup configuration. // Cleanup contains cleanup configuration.
// +optional // +optional
// +kubebuilder:default:={} Cleanup *CleanupOptions `json:"cleanup,omitempty"`
Cleanup CleanupOptions `json:"cleanup"`
// Clusters holds a registry to clusters to support multi-cluster tests. // Clusters holds a registry to clusters to support multi-cluster tests.
// +optional // +optional
Clusters Clusters `json:"clusters"` Clusters Clusters `json:"clusters,omitempty"`
// Deletion contains the global deletion configuration. // Deletion contains the global deletion configuration.
// +optional // +optional
@ -46,18 +44,15 @@ type ConfigurationSpec struct {
// Error contains the global error configuration. // Error contains the global error configuration.
// +optional // +optional
// +kubebuilder:default:={} Error *ErrorOptions `json:"error,omitempty"`
Error ErrorOptions `json:"error,omitempty"`
// Execution contains tests execution configuration. // Execution contains tests execution configuration.
// +optional // +optional
// +kubebuilder:default:={} Execution *ExecutionOptions `json:"execution,omitempty"`
Execution ExecutionOptions `json:"execution"`
// Namespace contains properties for the namespace to use for tests. // Namespace contains properties for the namespace to use for tests.
// +optional // +optional
// +kubebuilder:default:={} Namespace *NamespaceOptions `json:"namespace,omitempty"`
Namespace NamespaceOptions `json:"namespace"`
// Report contains properties for the report. // Report contains properties for the report.
// +optional // +optional
@ -71,5 +66,5 @@ type ConfigurationSpec struct {
// Global timeouts configuration. Applies to all tests/test steps if not overridden. // Global timeouts configuration. Applies to all tests/test steps if not overridden.
// +optional // +optional
// +kubebuilder:default:={} // +kubebuilder:default:={}
Timeouts DefaultTimeouts `json:"timeouts"` Timeouts Timeouts `json:"timeouts"`
} }

View File

@ -1,5 +1,6 @@
// Package v1alpha2 contains API Schema definitions for the v1alpha2 API group. // Package v1alpha2 contains API Schema definitions for the v1alpha2 API group.
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// +k8s:conversion-gen=github.com/kyverno/chainsaw/pkg/apis/v1alpha1
// +kubebuilder:object:generate=true // +kubebuilder:object:generate=true
// +groupName=chainsaw.kyverno.io // +groupName=chainsaw.kyverno.io
package v1alpha2 package v1alpha2

View File

@ -0,0 +1,115 @@
package v1alpha2
// Operation defines operation elements.
// +k8s:conversion-gen=false
type Operation struct {
OperationAction `json:",inline"`
OperationBindings `json:",inline"`
OperationClusters `json:",inline"`
OperationOutputs `json:",inline"`
// Description contains a description of the operation.
// +optional
Description string `json:"description,omitempty"`
}
// OperationAction defines an operation action, only one action should be specified per operation.
type OperationAction struct {
// Apply represents resources that should be applied for this test step. This can include things
// like configuration settings or any other resources that need to be available during the test.
// +optional
Apply *Apply `json:"apply,omitempty"`
// Assert represents an assertion to be made. It checks whether the conditions specified in the assertion hold true.
// +optional
Assert *Assert `json:"assert,omitempty"`
// Command defines a command to run.
// +optional
Command *Command `json:"command,omitempty"`
// Create represents a creation operation.
// +optional
Create *Create `json:"create,omitempty"`
// Delete represents a deletion operation.
// +optional
Delete *Delete `json:"delete,omitempty"`
// Describe determines the resource describe collector to execute.
// +optional
Describe *Describe `json:"describe,omitempty"`
// Error represents the expected errors for this test step. If any of these errors occur, the test
// will consider them as expected; otherwise, they will be treated as test failures.
// +optional
Error *Error `json:"error,omitempty"`
// Events determines the events collector to execute.
// +optional
Events *Events `json:"events,omitempty"`
// Get determines the resource get collector to execute.
// +optional
Get *Get `json:"get,omitempty"`
// Patch represents a patch operation.
// +optional
Patch *Patch `json:"patch,omitempty"`
// PodLogs determines the pod logs collector to execute.
// +optional
PodLogs *PodLogs `json:"podLogs,omitempty"`
// Script defines a script to run.
// +optional
Script *Script `json:"script,omitempty"`
// Sleep defines zzzz.
// +optional
Sleep *Sleep `json:"sleep,omitempty"`
// Update represents an update operation.
// +optional
Update *Update `json:"update,omitempty"`
// Wait determines the resource wait collector to execute.
// +optional
Wait *Wait `json:"wait,omitempty"`
}
// OperationBindings contains bindings options for an operation.
type OperationBindings struct {
// Bindings defines additional binding key/values.
// +optional
Bindings []Binding `json:"bindings,omitempty"`
}
// OperationClusters contains clusters options for an operation.
type OperationClusters struct {
// Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
// +optional
Cluster string `json:"cluster,omitempty"`
// Clusters holds a registry to clusters to support multi-cluster tests.
// +optional
Clusters Clusters `json:"clusters,omitempty"`
}
// OperationOutputs contains outputs options for an operation.
type OperationOutputs struct {
// Outputs defines output bindings.
// +optional
Outputs []Output `json:"outputs,omitempty"`
}
// TryOperation defines operation elements.
// +k8s:conversion-gen=false
type TryOperation struct {
Operation `json:",inline"`
// ContinueOnError determines whether a test should continue or not in case the operation was not successful.
// Even if the test continues executing, it will still be reported as failed.
// +optional
ContinueOnError *bool `json:"continueOnError,omitempty"`
}

View File

@ -1,7 +1,7 @@
package v1alpha2 package v1alpha2
import ( import (
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1" _ "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )
@ -52,7 +52,7 @@ type ErrorOptions struct {
// Catch defines what the tests steps will execute when an error happens. // Catch defines what the tests steps will execute when an error happens.
// This will be combined with catch handlers defined at the test and step levels. // This will be combined with catch handlers defined at the test and step levels.
// +optional // +optional
Catch []v1alpha1.CatchFinally `json:"catch,omitempty"` Catch []Operation `json:"catch,omitempty"`
} }
// ExecutionOptions determines how tests are run. // ExecutionOptions determines how tests are run.
@ -86,30 +86,23 @@ type NamespaceOptions struct {
// +optional // +optional
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
// Template defines a template to create the test namespace. // Template defines a template to create the test namespace.
// +optional // +optional
Template *Projection `json:"template,omitempty"` Template *Any `json:"template,omitempty"`
} }
type ReportFormatType string type ReportFormatType string
const ( const (
JSONFormat ReportFormatType = "JSON" JSONFormat ReportFormatType = "JSON"
XMLFormat ReportFormatType = "XML" XMLFormat ReportFormatType = "XML"
JUnitTestFormat ReportFormatType = "JUNIT-TEST"
JUnitStepFormat ReportFormatType = "JUNIT-STEP"
JUnitOperationFormat ReportFormatType = "JUNIT-OPERATION"
) )
// ReportOptions contains the configuration used for reporting. // ReportOptions contains the configuration used for reporting.
type ReportOptions struct { type ReportOptions struct {
// ReportFormat determines test report format (JSON, XML, JUNIT-TEST, JUNIT-STEP, JUNIT-OPERATION). // ReportFormat determines test report format (JSON|XML).
// +optional // +optional
// +kubebuilder:validation:Enum:=JSON;XML;JUNIT-TEST;JUNIT-STEP;JUNIT-OPERATION // +kubebuilder:validation:Enum:=JSON;XML
// +kubebuilder:default:="JSON" // +kubebuilder:default:="JSON"
Format ReportFormatType `json:"format,omitempty"` Format ReportFormatType `json:"format,omitempty"`
@ -129,8 +122,4 @@ type TemplatingOptions struct {
// +optional // +optional
// +kubebuilder:default:=true // +kubebuilder:default:=true
Enabled bool `json:"enabled"` Enabled bool `json:"enabled"`
// Compiler defines the default compiler to use when evaluating expressions.
// +optional
Compiler *Compiler `json:"compiler,omitempty"`
} }

View File

@ -0,0 +1,88 @@
package v1alpha2
import (
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
conversion "k8s.io/apimachinery/pkg/conversion"
)
func Convert_v1alpha2_ConfigurationSpec_To_v1alpha1_ConfigurationSpec(in *ConfigurationSpec, out *v1alpha1.ConfigurationSpec, _ conversion.Scope) error {
if in := in.Cleanup; in != nil {
out.SkipDelete = in.SkipDelete
out.DelayBeforeCleanup = in.DelayBeforeCleanup
}
out.Clusters = in.Clusters
out.DeletionPropagationPolicy = in.Deletion.Propagation
out.ExcludeTestRegex = in.Discovery.ExcludeTestRegex
out.IncludeTestRegex = in.Discovery.IncludeTestRegex
out.TestFile = in.Discovery.TestFile
out.FullName = in.Discovery.FullName
// TODO
// if in := in.Error; in != nil {
// out.Catch = in.Catch
// }
if in := in.Execution; in != nil {
out.FailFast = in.FailFast
out.Parallel = in.Parallel
out.RepeatCount = in.RepeatCount
out.ForceTerminationGracePeriod = in.ForceTerminationGracePeriod
}
if in := in.Namespace; in != nil {
out.Namespace = in.Name
out.NamespaceTemplate = in.Template
}
if in := in.Report; in != nil {
out.ReportFormat = v1alpha1.ReportFormatType(in.Format)
out.ReportPath = in.Path
out.ReportName = in.Name
}
out.Template = &in.Templating.Enabled
out.Timeouts = in.Timeouts
return nil
}
func Convert_v1alpha1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(in *v1alpha1.ConfigurationSpec, out *ConfigurationSpec, _ conversion.Scope) error {
out.Cleanup = &CleanupOptions{
SkipDelete: in.SkipDelete,
DelayBeforeCleanup: in.DelayBeforeCleanup,
}
out.Clusters = in.Clusters
out.Deletion = DeletionOptions{
Propagation: in.DeletionPropagationPolicy,
}
out.Discovery = DiscoveryOptions{
ExcludeTestRegex: in.ExcludeTestRegex,
IncludeTestRegex: in.IncludeTestRegex,
TestFile: in.TestFile,
FullName: in.FullName,
}
// TODO
// out.Error = &ErrorOptions{
// Catch: in.Catch,
// }
out.Execution = &ExecutionOptions{
FailFast: in.FailFast,
Parallel: in.Parallel,
RepeatCount: in.RepeatCount,
ForceTerminationGracePeriod: in.ForceTerminationGracePeriod,
}
out.Namespace = &NamespaceOptions{
Name: in.Namespace,
Template: in.NamespaceTemplate,
}
out.Report = &ReportOptions{
Format: ReportFormatType(in.ReportFormat),
Path: in.ReportPath,
Name: in.ReportName,
}
if in.Template == nil {
out.Templating = TemplatingOptions{
Enabled: true,
}
} else {
out.Templating = TemplatingOptions{
Enabled: *in.Template,
}
}
out.Timeouts = in.Timeouts
return nil
}

71
pkg/apis/v1alpha2/step.go Normal file
View File

@ -0,0 +1,71 @@
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// TestStep contains the test step definition used in a test spec.
// +k8s:conversion-gen=false
type TestStep struct {
// Name of the step.
// +optional
Name string `json:"name,omitempty"`
// TestStepSpec of the step.
TestStepSpec `json:",inline"`
}
// TestStepSpec defines the desired state and behavior for each test step.
// +k8s:conversion-gen=false
type TestStepSpec struct {
// Description contains a description of the test step.
// +optional
Description string `json:"description,omitempty"`
// Timeouts for the test step. Overrides the global timeouts set in the Configuration and the timeouts eventually set in the Test.
// +optional
Timeouts *Timeouts `json:"timeouts,omitempty"`
// DeletionPropagationPolicy decides if a deletion will propagate to the dependents of
// the object, and how the garbage collector will handle the propagation.
// Overrides the deletion propagation policy set in both the Configuration and the Test.
// +optional
// +kubebuilder:validation:Enum:=Orphan;Background;Foreground
DeletionPropagationPolicy *metav1.DeletionPropagation `json:"deletionPropagationPolicy,omitempty"`
// Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
// +optional
Cluster string `json:"cluster,omitempty"`
// Clusters holds a registry to clusters to support multi-cluster tests.
// +optional
Clusters Clusters `json:"clusters,omitempty"`
// SkipDelete determines whether the resources created by the step should be deleted after the test step is executed.
// +optional
SkipDelete *bool `json:"skipDelete,omitempty"`
// Template determines whether resources should be considered for templating.
// +optional
Template *bool `json:"template,omitempty"`
// Bindings defines additional binding key/values.
// +optional
Bindings []Binding `json:"bindings,omitempty"`
// Try defines what the step will try to execute.
// +kubebuilder:validation:MinItems:=1
Try []TryOperation `json:"try"`
// Catch defines what the step will execute when an error happens.
// +optional
Catch []Operation `json:"catch,omitempty"`
// Finally defines what the step will execute after the step is terminated.
// +optional
Finally []Operation `json:"finally,omitempty"`
// Cleanup defines what will be executed after the test is terminated.
// +optional
Cleanup []Operation `json:"cleanup,omitempty"`
}

96
pkg/apis/v1alpha2/test.go Normal file
View File

@ -0,0 +1,96 @@
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Cluster
// Test is the resource that contains a test definition.
type Test struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// Test spec.
Spec TestSpec `json:"spec"`
}
// TestSpec contains the test spec.
// +k8s:conversion-gen=false
type TestSpec struct {
// Cleanup contains cleanup configuration.
// +optional
// +kubebuilder:default:={}
Cleanup CleanupOptions `json:"cleanup"`
// Cluster defines the target cluster (default cluster will be used if not specified and/or overridden).
// +optional
Cluster string `json:"cluster,omitempty"`
// Clusters holds a registry to clusters to support multi-cluster tests.
// +optional
Clusters Clusters `json:"clusters,omitempty"`
// Execution contains tests execution configuration.
// +optional
// +kubebuilder:default:={}
Execution TestExecutionOptions `json:"execution"`
// Bindings defines additional binding key/values.
// +optional
Bindings []Binding `json:"bindings,omitempty"`
// Deletion contains the global deletion configuration.
// +optional
// +kubebuilder:default:={}
Deletion DeletionOptions `json:"deletion"`
// Description contains a description of the test.
// +optional
Description string `json:"description,omitempty"`
// Error contains the global error configuration.
// +optional
// +kubebuilder:default:={}
Error ErrorOptions `json:"error"`
// Namespace contains properties for the namespace to use for tests.
// +optional
// +kubebuilder:default:={}
Namespace NamespaceOptions `json:"namespace"`
// Steps defining the test.
Steps []TestStep `json:"steps"`
// Templating contains the templating config.
// +optional
// +kubebuilder:default:={}
Templating TemplatingOptions `json:"templating"`
// Timeouts for the test. Overrides the global timeouts set in the Configuration on a per operation basis.
// +optional
// +kubebuilder:default:={}
Timeouts Timeouts `json:"timeouts"`
}
// TestExecutionOptions determines how tests are run.
type TestExecutionOptions struct {
// Concurrent determines whether the test should run concurrently with other tests.
// +optional
// +kubebuilder:default:=true
Concurrent bool `json:"concurrent"`
// Skip determines whether the test should skipped.
// +optional
Skip bool `json:"skip,omitempty"`
// TerminationGracePeriod forces the termination grace period on pods, statefulsets, daemonsets and deployments.
// +optional
TerminationGracePeriod *metav1.Duration `json:"terminationGracePeriod,omitempty"`
}

View File

@ -0,0 +1,14 @@
package v1alpha2
import (
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
conversion "k8s.io/apimachinery/pkg/conversion"
)
func Convert_v1alpha2_TestSpec_To_v1alpha1_TestSpec(in *TestSpec, out *v1alpha1.TestSpec, s conversion.Scope) error {
return nil
}
func Convert_v1alpha1_TestSpec_To_v1alpha2_TestSpec(in *v1alpha1.TestSpec, out *TestSpec, s conversion.Scope) error {
return nil
}

View File

@ -3,16 +3,32 @@ package v1alpha2
import ( import (
"github.com/kyverno/chainsaw/pkg/apis/v1alpha1" "github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
_ "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" _ "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
) metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
const (
EngineJP = v1alpha1.EngineJP
EngineCEL = v1alpha1.EngineCEL
) )
type ( type (
Clusters = v1alpha1.Clusters Any = v1alpha1.Any
Compiler = v1alpha1.Compiler Binding = v1alpha1.Binding
DefaultTimeouts = v1alpha1.DefaultTimeouts Check = v1alpha1.Check
Projection = v1alpha1.Projection Cluster = v1alpha1.Cluster
Clusters = v1alpha1.Clusters
Expectation = v1alpha1.Expectation
Format = v1alpha1.Format
ObjectName = v1alpha1.ObjectName
ObjectType = v1alpha1.ObjectType
Output = v1alpha1.Output
Timeouts = v1alpha1.Timeouts
) )
// ObjectReference represents one or more objects with a specific apiVersion and kind.
// For a single object name and namespace are used to identify the object.
// For multiple objects use labels.
// +k8s:conversion-gen=false
type ObjectReference struct {
ObjectType `json:",inline"`
ObjectName `json:",inline"`
// Label selector to match objects to delete
// +optional
Labels *metav1.LabelSelector `json:"labelSelector,omitempty"`
}

View File

@ -0,0 +1,521 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by conversion-gen. DO NOT EDIT.
package v1alpha2
import (
unsafe "unsafe"
v1alpha1 "github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
policyv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
)
func init() {
localSchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*ActionCheck)(nil), (*v1alpha1.ActionCheck)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionCheck_To_v1alpha1_ActionCheck(a.(*ActionCheck), b.(*v1alpha1.ActionCheck), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionCheck)(nil), (*ActionCheck)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionCheck_To_v1alpha2_ActionCheck(a.(*v1alpha1.ActionCheck), b.(*ActionCheck), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionCheckRef)(nil), (*v1alpha1.ActionCheckRef)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionCheckRef_To_v1alpha1_ActionCheckRef(a.(*ActionCheckRef), b.(*v1alpha1.ActionCheckRef), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionCheckRef)(nil), (*ActionCheckRef)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionCheckRef_To_v1alpha2_ActionCheckRef(a.(*v1alpha1.ActionCheckRef), b.(*ActionCheckRef), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionDryRun)(nil), (*v1alpha1.ActionDryRun)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionDryRun_To_v1alpha1_ActionDryRun(a.(*ActionDryRun), b.(*v1alpha1.ActionDryRun), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionDryRun)(nil), (*ActionDryRun)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionDryRun_To_v1alpha2_ActionDryRun(a.(*v1alpha1.ActionDryRun), b.(*ActionDryRun), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionEnv)(nil), (*v1alpha1.ActionEnv)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionEnv_To_v1alpha1_ActionEnv(a.(*ActionEnv), b.(*v1alpha1.ActionEnv), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionEnv)(nil), (*ActionEnv)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionEnv_To_v1alpha2_ActionEnv(a.(*v1alpha1.ActionEnv), b.(*ActionEnv), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionExpectations)(nil), (*v1alpha1.ActionExpectations)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionExpectations_To_v1alpha1_ActionExpectations(a.(*ActionExpectations), b.(*v1alpha1.ActionExpectations), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionExpectations)(nil), (*ActionExpectations)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionExpectations_To_v1alpha2_ActionExpectations(a.(*v1alpha1.ActionExpectations), b.(*ActionExpectations), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionFormat)(nil), (*v1alpha1.ActionFormat)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionFormat_To_v1alpha1_ActionFormat(a.(*ActionFormat), b.(*v1alpha1.ActionFormat), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionFormat)(nil), (*ActionFormat)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionFormat_To_v1alpha2_ActionFormat(a.(*v1alpha1.ActionFormat), b.(*ActionFormat), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionInlineResource)(nil), (*v1alpha1.ActionInlineResource)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionInlineResource_To_v1alpha1_ActionInlineResource(a.(*ActionInlineResource), b.(*v1alpha1.ActionInlineResource), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionInlineResource)(nil), (*ActionInlineResource)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionInlineResource_To_v1alpha2_ActionInlineResource(a.(*v1alpha1.ActionInlineResource), b.(*ActionInlineResource), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionObject)(nil), (*v1alpha1.ActionObject)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionObject_To_v1alpha1_ActionObject(a.(*ActionObject), b.(*v1alpha1.ActionObject), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionObject)(nil), (*ActionObject)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionObject_To_v1alpha2_ActionObject(a.(*v1alpha1.ActionObject), b.(*ActionObject), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionObjectSelector)(nil), (*v1alpha1.ActionObjectSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionObjectSelector_To_v1alpha1_ActionObjectSelector(a.(*ActionObjectSelector), b.(*v1alpha1.ActionObjectSelector), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionObjectSelector)(nil), (*ActionObjectSelector)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionObjectSelector_To_v1alpha2_ActionObjectSelector(a.(*v1alpha1.ActionObjectSelector), b.(*ActionObjectSelector), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionResourceRef)(nil), (*v1alpha1.ActionResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionResourceRef_To_v1alpha1_ActionResourceRef(a.(*ActionResourceRef), b.(*v1alpha1.ActionResourceRef), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionResourceRef)(nil), (*ActionResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionResourceRef_To_v1alpha2_ActionResourceRef(a.(*v1alpha1.ActionResourceRef), b.(*ActionResourceRef), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*ActionTimeout)(nil), (*v1alpha1.ActionTimeout)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ActionTimeout_To_v1alpha1_ActionTimeout(a.(*ActionTimeout), b.(*v1alpha1.ActionTimeout), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.ActionTimeout)(nil), (*ActionTimeout)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ActionTimeout_To_v1alpha2_ActionTimeout(a.(*v1alpha1.ActionTimeout), b.(*ActionTimeout), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*Configuration)(nil), (*v1alpha1.Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_Configuration_To_v1alpha1_Configuration(a.(*Configuration), b.(*v1alpha1.Configuration), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.Configuration)(nil), (*Configuration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_Configuration_To_v1alpha2_Configuration(a.(*v1alpha1.Configuration), b.(*Configuration), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*FileRef)(nil), (*v1alpha1.FileRef)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_FileRef_To_v1alpha1_FileRef(a.(*FileRef), b.(*v1alpha1.FileRef), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.FileRef)(nil), (*FileRef)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_FileRef_To_v1alpha2_FileRef(a.(*v1alpha1.FileRef), b.(*FileRef), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*Test)(nil), (*v1alpha1.Test)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_Test_To_v1alpha1_Test(a.(*Test), b.(*v1alpha1.Test), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*v1alpha1.Test)(nil), (*Test)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_Test_To_v1alpha2_Test(a.(*v1alpha1.Test), b.(*Test), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*v1alpha1.ConfigurationSpec)(nil), (*ConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(a.(*v1alpha1.ConfigurationSpec), b.(*ConfigurationSpec), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*v1alpha1.TestSpec)(nil), (*TestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_TestSpec_To_v1alpha2_TestSpec(a.(*v1alpha1.TestSpec), b.(*TestSpec), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*ConfigurationSpec)(nil), (*v1alpha1.ConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_ConfigurationSpec_To_v1alpha1_ConfigurationSpec(a.(*ConfigurationSpec), b.(*v1alpha1.ConfigurationSpec), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*TestSpec)(nil), (*v1alpha1.TestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_TestSpec_To_v1alpha1_TestSpec(a.(*TestSpec), b.(*v1alpha1.TestSpec), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_v1alpha2_ActionCheck_To_v1alpha1_ActionCheck(in *ActionCheck, out *v1alpha1.ActionCheck, s conversion.Scope) error {
out.Check = (*policyv1alpha1.Any)(unsafe.Pointer(in.Check))
return nil
}
// Convert_v1alpha2_ActionCheck_To_v1alpha1_ActionCheck is an autogenerated conversion function.
func Convert_v1alpha2_ActionCheck_To_v1alpha1_ActionCheck(in *ActionCheck, out *v1alpha1.ActionCheck, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionCheck_To_v1alpha1_ActionCheck(in, out, s)
}
func autoConvert_v1alpha1_ActionCheck_To_v1alpha2_ActionCheck(in *v1alpha1.ActionCheck, out *ActionCheck, s conversion.Scope) error {
out.Check = (*policyv1alpha1.Any)(unsafe.Pointer(in.Check))
return nil
}
// Convert_v1alpha1_ActionCheck_To_v1alpha2_ActionCheck is an autogenerated conversion function.
func Convert_v1alpha1_ActionCheck_To_v1alpha2_ActionCheck(in *v1alpha1.ActionCheck, out *ActionCheck, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionCheck_To_v1alpha2_ActionCheck(in, out, s)
}
func autoConvert_v1alpha2_ActionCheckRef_To_v1alpha1_ActionCheckRef(in *ActionCheckRef, out *v1alpha1.ActionCheckRef, s conversion.Scope) error {
if err := Convert_v1alpha2_FileRef_To_v1alpha1_FileRef(&in.FileRef, &out.FileRef, s); err != nil {
return err
}
out.Check = (*policyv1alpha1.Any)(unsafe.Pointer(in.Check))
out.Template = (*bool)(unsafe.Pointer(in.Template))
return nil
}
// Convert_v1alpha2_ActionCheckRef_To_v1alpha1_ActionCheckRef is an autogenerated conversion function.
func Convert_v1alpha2_ActionCheckRef_To_v1alpha1_ActionCheckRef(in *ActionCheckRef, out *v1alpha1.ActionCheckRef, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionCheckRef_To_v1alpha1_ActionCheckRef(in, out, s)
}
func autoConvert_v1alpha1_ActionCheckRef_To_v1alpha2_ActionCheckRef(in *v1alpha1.ActionCheckRef, out *ActionCheckRef, s conversion.Scope) error {
if err := Convert_v1alpha1_FileRef_To_v1alpha2_FileRef(&in.FileRef, &out.FileRef, s); err != nil {
return err
}
out.Check = (*policyv1alpha1.Any)(unsafe.Pointer(in.Check))
out.Template = (*bool)(unsafe.Pointer(in.Template))
return nil
}
// Convert_v1alpha1_ActionCheckRef_To_v1alpha2_ActionCheckRef is an autogenerated conversion function.
func Convert_v1alpha1_ActionCheckRef_To_v1alpha2_ActionCheckRef(in *v1alpha1.ActionCheckRef, out *ActionCheckRef, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionCheckRef_To_v1alpha2_ActionCheckRef(in, out, s)
}
func autoConvert_v1alpha2_ActionDryRun_To_v1alpha1_ActionDryRun(in *ActionDryRun, out *v1alpha1.ActionDryRun, s conversion.Scope) error {
out.DryRun = (*bool)(unsafe.Pointer(in.DryRun))
return nil
}
// Convert_v1alpha2_ActionDryRun_To_v1alpha1_ActionDryRun is an autogenerated conversion function.
func Convert_v1alpha2_ActionDryRun_To_v1alpha1_ActionDryRun(in *ActionDryRun, out *v1alpha1.ActionDryRun, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionDryRun_To_v1alpha1_ActionDryRun(in, out, s)
}
func autoConvert_v1alpha1_ActionDryRun_To_v1alpha2_ActionDryRun(in *v1alpha1.ActionDryRun, out *ActionDryRun, s conversion.Scope) error {
out.DryRun = (*bool)(unsafe.Pointer(in.DryRun))
return nil
}
// Convert_v1alpha1_ActionDryRun_To_v1alpha2_ActionDryRun is an autogenerated conversion function.
func Convert_v1alpha1_ActionDryRun_To_v1alpha2_ActionDryRun(in *v1alpha1.ActionDryRun, out *ActionDryRun, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionDryRun_To_v1alpha2_ActionDryRun(in, out, s)
}
func autoConvert_v1alpha2_ActionEnv_To_v1alpha1_ActionEnv(in *ActionEnv, out *v1alpha1.ActionEnv, s conversion.Scope) error {
out.Env = *(*[]v1alpha1.Binding)(unsafe.Pointer(&in.Env))
out.SkipLogOutput = in.SkipLogOutput
return nil
}
// Convert_v1alpha2_ActionEnv_To_v1alpha1_ActionEnv is an autogenerated conversion function.
func Convert_v1alpha2_ActionEnv_To_v1alpha1_ActionEnv(in *ActionEnv, out *v1alpha1.ActionEnv, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionEnv_To_v1alpha1_ActionEnv(in, out, s)
}
func autoConvert_v1alpha1_ActionEnv_To_v1alpha2_ActionEnv(in *v1alpha1.ActionEnv, out *ActionEnv, s conversion.Scope) error {
out.Env = *(*[]v1alpha1.Binding)(unsafe.Pointer(&in.Env))
out.SkipLogOutput = in.SkipLogOutput
return nil
}
// Convert_v1alpha1_ActionEnv_To_v1alpha2_ActionEnv is an autogenerated conversion function.
func Convert_v1alpha1_ActionEnv_To_v1alpha2_ActionEnv(in *v1alpha1.ActionEnv, out *ActionEnv, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionEnv_To_v1alpha2_ActionEnv(in, out, s)
}
func autoConvert_v1alpha2_ActionExpectations_To_v1alpha1_ActionExpectations(in *ActionExpectations, out *v1alpha1.ActionExpectations, s conversion.Scope) error {
out.Expect = *(*[]v1alpha1.Expectation)(unsafe.Pointer(&in.Expect))
return nil
}
// Convert_v1alpha2_ActionExpectations_To_v1alpha1_ActionExpectations is an autogenerated conversion function.
func Convert_v1alpha2_ActionExpectations_To_v1alpha1_ActionExpectations(in *ActionExpectations, out *v1alpha1.ActionExpectations, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionExpectations_To_v1alpha1_ActionExpectations(in, out, s)
}
func autoConvert_v1alpha1_ActionExpectations_To_v1alpha2_ActionExpectations(in *v1alpha1.ActionExpectations, out *ActionExpectations, s conversion.Scope) error {
out.Expect = *(*[]v1alpha1.Expectation)(unsafe.Pointer(&in.Expect))
return nil
}
// Convert_v1alpha1_ActionExpectations_To_v1alpha2_ActionExpectations is an autogenerated conversion function.
func Convert_v1alpha1_ActionExpectations_To_v1alpha2_ActionExpectations(in *v1alpha1.ActionExpectations, out *ActionExpectations, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionExpectations_To_v1alpha2_ActionExpectations(in, out, s)
}
func autoConvert_v1alpha2_ActionFormat_To_v1alpha1_ActionFormat(in *ActionFormat, out *v1alpha1.ActionFormat, s conversion.Scope) error {
out.Format = v1alpha1.Format(in.Format)
return nil
}
// Convert_v1alpha2_ActionFormat_To_v1alpha1_ActionFormat is an autogenerated conversion function.
func Convert_v1alpha2_ActionFormat_To_v1alpha1_ActionFormat(in *ActionFormat, out *v1alpha1.ActionFormat, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionFormat_To_v1alpha1_ActionFormat(in, out, s)
}
func autoConvert_v1alpha1_ActionFormat_To_v1alpha2_ActionFormat(in *v1alpha1.ActionFormat, out *ActionFormat, s conversion.Scope) error {
out.Format = v1alpha1.Format(in.Format)
return nil
}
// Convert_v1alpha1_ActionFormat_To_v1alpha2_ActionFormat is an autogenerated conversion function.
func Convert_v1alpha1_ActionFormat_To_v1alpha2_ActionFormat(in *v1alpha1.ActionFormat, out *ActionFormat, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionFormat_To_v1alpha2_ActionFormat(in, out, s)
}
func autoConvert_v1alpha2_ActionInlineResource_To_v1alpha1_ActionInlineResource(in *ActionInlineResource, out *v1alpha1.ActionInlineResource, s conversion.Scope) error {
out.Resource = (*unstructured.Unstructured)(unsafe.Pointer(in.Resource))
return nil
}
// Convert_v1alpha2_ActionInlineResource_To_v1alpha1_ActionInlineResource is an autogenerated conversion function.
func Convert_v1alpha2_ActionInlineResource_To_v1alpha1_ActionInlineResource(in *ActionInlineResource, out *v1alpha1.ActionInlineResource, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionInlineResource_To_v1alpha1_ActionInlineResource(in, out, s)
}
func autoConvert_v1alpha1_ActionInlineResource_To_v1alpha2_ActionInlineResource(in *v1alpha1.ActionInlineResource, out *ActionInlineResource, s conversion.Scope) error {
out.Resource = (*unstructured.Unstructured)(unsafe.Pointer(in.Resource))
return nil
}
// Convert_v1alpha1_ActionInlineResource_To_v1alpha2_ActionInlineResource is an autogenerated conversion function.
func Convert_v1alpha1_ActionInlineResource_To_v1alpha2_ActionInlineResource(in *v1alpha1.ActionInlineResource, out *ActionInlineResource, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionInlineResource_To_v1alpha2_ActionInlineResource(in, out, s)
}
func autoConvert_v1alpha2_ActionObject_To_v1alpha1_ActionObject(in *ActionObject, out *v1alpha1.ActionObject, s conversion.Scope) error {
out.ObjectType = in.ObjectType
if err := Convert_v1alpha2_ActionObjectSelector_To_v1alpha1_ActionObjectSelector(&in.ActionObjectSelector, &out.ActionObjectSelector, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha2_ActionObject_To_v1alpha1_ActionObject is an autogenerated conversion function.
func Convert_v1alpha2_ActionObject_To_v1alpha1_ActionObject(in *ActionObject, out *v1alpha1.ActionObject, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionObject_To_v1alpha1_ActionObject(in, out, s)
}
func autoConvert_v1alpha1_ActionObject_To_v1alpha2_ActionObject(in *v1alpha1.ActionObject, out *ActionObject, s conversion.Scope) error {
out.ObjectType = in.ObjectType
if err := Convert_v1alpha1_ActionObjectSelector_To_v1alpha2_ActionObjectSelector(&in.ActionObjectSelector, &out.ActionObjectSelector, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha1_ActionObject_To_v1alpha2_ActionObject is an autogenerated conversion function.
func Convert_v1alpha1_ActionObject_To_v1alpha2_ActionObject(in *v1alpha1.ActionObject, out *ActionObject, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionObject_To_v1alpha2_ActionObject(in, out, s)
}
func autoConvert_v1alpha2_ActionObjectSelector_To_v1alpha1_ActionObjectSelector(in *ActionObjectSelector, out *v1alpha1.ActionObjectSelector, s conversion.Scope) error {
out.ObjectName = in.ObjectName
out.Selector = in.Selector
return nil
}
// Convert_v1alpha2_ActionObjectSelector_To_v1alpha1_ActionObjectSelector is an autogenerated conversion function.
func Convert_v1alpha2_ActionObjectSelector_To_v1alpha1_ActionObjectSelector(in *ActionObjectSelector, out *v1alpha1.ActionObjectSelector, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionObjectSelector_To_v1alpha1_ActionObjectSelector(in, out, s)
}
func autoConvert_v1alpha1_ActionObjectSelector_To_v1alpha2_ActionObjectSelector(in *v1alpha1.ActionObjectSelector, out *ActionObjectSelector, s conversion.Scope) error {
out.ObjectName = in.ObjectName
out.Selector = in.Selector
return nil
}
// Convert_v1alpha1_ActionObjectSelector_To_v1alpha2_ActionObjectSelector is an autogenerated conversion function.
func Convert_v1alpha1_ActionObjectSelector_To_v1alpha2_ActionObjectSelector(in *v1alpha1.ActionObjectSelector, out *ActionObjectSelector, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionObjectSelector_To_v1alpha2_ActionObjectSelector(in, out, s)
}
func autoConvert_v1alpha2_ActionResourceRef_To_v1alpha1_ActionResourceRef(in *ActionResourceRef, out *v1alpha1.ActionResourceRef, s conversion.Scope) error {
if err := Convert_v1alpha2_FileRef_To_v1alpha1_FileRef(&in.FileRef, &out.FileRef, s); err != nil {
return err
}
out.Resource = (*unstructured.Unstructured)(unsafe.Pointer(in.Resource))
out.Template = (*bool)(unsafe.Pointer(in.Template))
return nil
}
// Convert_v1alpha2_ActionResourceRef_To_v1alpha1_ActionResourceRef is an autogenerated conversion function.
func Convert_v1alpha2_ActionResourceRef_To_v1alpha1_ActionResourceRef(in *ActionResourceRef, out *v1alpha1.ActionResourceRef, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionResourceRef_To_v1alpha1_ActionResourceRef(in, out, s)
}
func autoConvert_v1alpha1_ActionResourceRef_To_v1alpha2_ActionResourceRef(in *v1alpha1.ActionResourceRef, out *ActionResourceRef, s conversion.Scope) error {
if err := Convert_v1alpha1_FileRef_To_v1alpha2_FileRef(&in.FileRef, &out.FileRef, s); err != nil {
return err
}
out.Resource = (*unstructured.Unstructured)(unsafe.Pointer(in.Resource))
out.Template = (*bool)(unsafe.Pointer(in.Template))
return nil
}
// Convert_v1alpha1_ActionResourceRef_To_v1alpha2_ActionResourceRef is an autogenerated conversion function.
func Convert_v1alpha1_ActionResourceRef_To_v1alpha2_ActionResourceRef(in *v1alpha1.ActionResourceRef, out *ActionResourceRef, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionResourceRef_To_v1alpha2_ActionResourceRef(in, out, s)
}
func autoConvert_v1alpha2_ActionTimeout_To_v1alpha1_ActionTimeout(in *ActionTimeout, out *v1alpha1.ActionTimeout, s conversion.Scope) error {
out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout))
return nil
}
// Convert_v1alpha2_ActionTimeout_To_v1alpha1_ActionTimeout is an autogenerated conversion function.
func Convert_v1alpha2_ActionTimeout_To_v1alpha1_ActionTimeout(in *ActionTimeout, out *v1alpha1.ActionTimeout, s conversion.Scope) error {
return autoConvert_v1alpha2_ActionTimeout_To_v1alpha1_ActionTimeout(in, out, s)
}
func autoConvert_v1alpha1_ActionTimeout_To_v1alpha2_ActionTimeout(in *v1alpha1.ActionTimeout, out *ActionTimeout, s conversion.Scope) error {
out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout))
return nil
}
// Convert_v1alpha1_ActionTimeout_To_v1alpha2_ActionTimeout is an autogenerated conversion function.
func Convert_v1alpha1_ActionTimeout_To_v1alpha2_ActionTimeout(in *v1alpha1.ActionTimeout, out *ActionTimeout, s conversion.Scope) error {
return autoConvert_v1alpha1_ActionTimeout_To_v1alpha2_ActionTimeout(in, out, s)
}
func autoConvert_v1alpha2_Configuration_To_v1alpha1_Configuration(in *Configuration, out *v1alpha1.Configuration, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha2_ConfigurationSpec_To_v1alpha1_ConfigurationSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha2_Configuration_To_v1alpha1_Configuration is an autogenerated conversion function.
func Convert_v1alpha2_Configuration_To_v1alpha1_Configuration(in *Configuration, out *v1alpha1.Configuration, s conversion.Scope) error {
return autoConvert_v1alpha2_Configuration_To_v1alpha1_Configuration(in, out, s)
}
func autoConvert_v1alpha1_Configuration_To_v1alpha2_Configuration(in *v1alpha1.Configuration, out *Configuration, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha1_Configuration_To_v1alpha2_Configuration is an autogenerated conversion function.
func Convert_v1alpha1_Configuration_To_v1alpha2_Configuration(in *v1alpha1.Configuration, out *Configuration, s conversion.Scope) error {
return autoConvert_v1alpha1_Configuration_To_v1alpha2_Configuration(in, out, s)
}
func autoConvert_v1alpha2_FileRef_To_v1alpha1_FileRef(in *FileRef, out *v1alpha1.FileRef, s conversion.Scope) error {
out.File = in.File
return nil
}
// Convert_v1alpha2_FileRef_To_v1alpha1_FileRef is an autogenerated conversion function.
func Convert_v1alpha2_FileRef_To_v1alpha1_FileRef(in *FileRef, out *v1alpha1.FileRef, s conversion.Scope) error {
return autoConvert_v1alpha2_FileRef_To_v1alpha1_FileRef(in, out, s)
}
func autoConvert_v1alpha1_FileRef_To_v1alpha2_FileRef(in *v1alpha1.FileRef, out *FileRef, s conversion.Scope) error {
out.File = in.File
return nil
}
// Convert_v1alpha1_FileRef_To_v1alpha2_FileRef is an autogenerated conversion function.
func Convert_v1alpha1_FileRef_To_v1alpha2_FileRef(in *v1alpha1.FileRef, out *FileRef, s conversion.Scope) error {
return autoConvert_v1alpha1_FileRef_To_v1alpha2_FileRef(in, out, s)
}
func autoConvert_v1alpha2_Test_To_v1alpha1_Test(in *Test, out *v1alpha1.Test, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha2_TestSpec_To_v1alpha1_TestSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha2_Test_To_v1alpha1_Test is an autogenerated conversion function.
func Convert_v1alpha2_Test_To_v1alpha1_Test(in *Test, out *v1alpha1.Test, s conversion.Scope) error {
return autoConvert_v1alpha2_Test_To_v1alpha1_Test(in, out, s)
}
func autoConvert_v1alpha1_Test_To_v1alpha2_Test(in *v1alpha1.Test, out *Test, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha1_TestSpec_To_v1alpha2_TestSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha1_Test_To_v1alpha2_Test is an autogenerated conversion function.
func Convert_v1alpha1_Test_To_v1alpha2_Test(in *v1alpha1.Test, out *Test, s conversion.Scope) error {
return autoConvert_v1alpha1_Test_To_v1alpha2_Test(in, out, s)
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,3 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/* /*
Copyright The Kubernetes Authors. Copyright The Kubernetes Authors.
@ -23,8 +20,8 @@ package v1alpha2
import ( import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
// GroupName specifies the group name used to register the objects. // GroupName specifies the group name used to register the objects.
@ -46,7 +43,7 @@ var (
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder runtime.SchemeBuilder SchemeBuilder runtime.SchemeBuilder
localSchemeBuilder = &SchemeBuilder localSchemeBuilder = &SchemeBuilder
// Deprecated: use Install instead // Depreciated: use Install instead
AddToScheme = localSchemeBuilder.AddToScheme AddToScheme = localSchemeBuilder.AddToScheme
Install = localSchemeBuilder.AddToScheme Install = localSchemeBuilder.AddToScheme
) )
@ -62,6 +59,7 @@ func init() {
func addKnownTypes(scheme *runtime.Scheme) error { func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion, scheme.AddKnownTypes(SchemeGroupVersion,
&Configuration{}, &Configuration{},
&Test{},
) )
// AddToGroupVersion allows the serialization of client types like ListOptions. // AddToGroupVersion allows the serialization of client types like ListOptions.
v1.AddToGroupVersion(scheme, SchemeGroupVersion) v1.AddToGroupVersion(scheme, SchemeGroupVersion)

View File

@ -1,89 +0,0 @@
package cleaner
import (
"context"
"time"
"github.com/kyverno/chainsaw/pkg/client"
"github.com/kyverno/chainsaw/pkg/model"
kerrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type cleanupEntry struct {
client client.Client
object client.Object
}
type CleanerCollector interface {
Empty() bool
Add(client.Client, client.Object)
}
type Cleaner interface {
CleanerCollector
Run(ctx context.Context, stepReport *model.StepReport) []error
}
func New(timeout time.Duration, delay *time.Duration, propagation metav1.DeletionPropagation) Cleaner {
return &cleaner{
delay: delay,
timeout: timeout,
propagation: propagation,
}
}
type cleaner struct {
delay *time.Duration
timeout time.Duration
propagation metav1.DeletionPropagation
entries []cleanupEntry
}
func (c *cleaner) Add(client client.Client, object client.Object) {
c.entries = append(c.entries, cleanupEntry{
client: client,
object: object,
})
}
func (c *cleaner) Empty() bool {
return len(c.entries) == 0
}
func (c *cleaner) Run(ctx context.Context, stepReport *model.StepReport) []error {
if c.delay != nil {
time.Sleep(*c.delay)
}
var errs []error
for i := len(c.entries) - 1; i >= 0; i-- {
report := model.OperationReport{
Type: model.OperationTypeDelete,
StartTime: time.Now(),
}
if report.Err = c.delete(ctx, c.entries[i]); report.Err != nil {
errs = append(errs, report.Err)
}
report.EndTime = time.Now()
if stepReport != nil {
stepReport.Add(&report)
}
}
return errs
}
func (c *cleaner) delete(ctx context.Context, entry cleanupEntry) error {
if c.timeout != 0 {
_ctx, cancel := context.WithTimeout(ctx, c.timeout)
defer cancel()
ctx = _ctx
}
if err := entry.client.Delete(ctx, entry.object, client.PropagationPolicy(c.propagation)); err != nil {
if !kerrors.IsNotFound(err) {
return err
}
} else if err := client.WaitForDeletion(ctx, entry.client, entry.object); err != nil {
return err
}
return nil
}

View File

@ -1,204 +0,0 @@
package cleaner
import (
"context"
"errors"
"testing"
"time"
"github.com/kyverno/chainsaw/pkg/client"
tclient "github.com/kyverno/chainsaw/pkg/client/testing"
"github.com/kyverno/chainsaw/pkg/model"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
kerror "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/utils/ptr"
)
func TestNew(t *testing.T) {
tests := []struct {
name string
timeout time.Duration
delay *time.Duration
want Cleaner
}{{
name: "with timeout",
timeout: time.Minute,
delay: nil,
want: &cleaner{
timeout: time.Minute,
delay: nil,
propagation: metav1.DeletePropagationBackground,
},
}, {
name: "with delay",
timeout: time.Minute,
delay: ptr.To(10 * time.Second),
want: &cleaner{
timeout: time.Minute,
delay: ptr.To(10 * time.Second),
propagation: metav1.DeletePropagationBackground,
},
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := New(tt.timeout, tt.delay, metav1.DeletePropagationBackground)
assert.Equal(t, tt.want, got)
})
}
}
func Test_cleaner_Empty(t *testing.T) {
tests := []struct {
name string
entries []cleanupEntry
want bool
}{{
name: "without entries",
entries: nil,
want: true,
}, {
name: "without entries",
entries: []cleanupEntry{},
want: true,
}, {
name: "with entries",
entries: []cleanupEntry{{}},
want: false,
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &cleaner{
entries: tt.entries,
}
got := c.Empty()
assert.Equal(t, tt.want, got)
})
}
}
func Test_cleaner_Add(t *testing.T) {
entry := cleanupEntry{
object: &unstructured.Unstructured{},
client: &tclient.FakeClient{},
}
tests := []struct {
name string
entries []cleanupEntry
client client.Client
object client.Object
want []cleanupEntry
}{{
name: "empty",
client: entry.client,
object: entry.object,
want: []cleanupEntry{entry},
}, {
name: "with entries",
entries: []cleanupEntry{entry},
client: entry.client,
object: entry.object,
want: []cleanupEntry{entry, entry},
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &cleaner{
entries: tt.entries,
}
c.Add(tt.client, tt.object)
assert.Equal(t, tt.want, c.entries)
})
}
}
func Test_cleaner_Run(t *testing.T) {
obj := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
}
tests := []struct {
name string
entries []cleanupEntry
want []error
}{{
name: "empty",
}, {
name: "ok",
entries: []cleanupEntry{{
object: obj,
client: &tclient.FakeClient{
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error {
return nil
},
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error {
return kerror.NewNotFound(corev1.Resource("namespace"), "foo")
},
},
}},
want: nil,
}, {
name: "not found",
entries: []cleanupEntry{{
object: obj,
client: &tclient.FakeClient{
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error {
return kerror.NewNotFound(corev1.Resource("namespace"), "foo")
},
},
}},
want: nil,
}, {
name: "delete error",
entries: []cleanupEntry{{
object: obj,
client: &tclient.FakeClient{
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error {
return errors.New("dummy")
},
},
}},
want: []error{errors.New("dummy")},
}, {
name: "get error",
entries: []cleanupEntry{{
object: obj,
client: &tclient.FakeClient{
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error {
return nil
},
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error {
return errors.New("dummy")
},
},
}},
want: []error{errors.New("dummy")},
}, {
name: "failed",
entries: []cleanupEntry{{
object: obj,
client: &tclient.FakeClient{
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error {
return nil
},
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error {
return nil
},
},
}},
want: []error{context.DeadlineExceeded},
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &cleaner{
delay: ptr.To(time.Second),
timeout: 1 * time.Second,
entries: tt.entries,
}
got := c.Run(context.TODO(), &model.StepReport{})
assert.Equal(t, tt.want, got)
})
}
}

View File

@ -1,4 +1,4 @@
package simple package client
import ( import (
_ "k8s.io/client-go/plugin/pkg/client/auth" // package needed for auth providers like GCP _ "k8s.io/client-go/plugin/pkg/client/auth" // package needed for auth providers like GCP

View File

@ -5,33 +5,35 @@ import (
"k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
) )
type Client interface { type Client interface {
// Get retrieves an obj for the given object key from the Kubernetes Cluster. // Get retrieves an obj for the given object key from the Kubernetes Cluster.
// obj must be a struct pointer so that obj can be updated with the response // obj must be a struct pointer so that obj can be updated with the response
// returned by the Server. // returned by the Server.
Get(ctx context.Context, key ObjectKey, obj Object, opts ...GetOption) error Get(ctx context.Context, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error
// List retrieves list of objects for a given namespace and list options. On a // List retrieves list of objects for a given namespace and list options. On a
// successful call, Items field in the list will be populated with the // successful call, Items field in the list will be populated with the
// result returned from the server. // result returned from the server.
List(ctx context.Context, list ObjectList, opts ...ListOption) error List(ctx context.Context, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error
// Create saves the object obj in the Kubernetes cluster. obj must be a // Create saves the object obj in the Kubernetes cluster. obj must be a
// struct pointer so that obj can be updated with the content returned by the Server. // struct pointer so that obj can be updated with the content returned by the Server.
Create(ctx context.Context, obj Object, opts ...CreateOption) error Create(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error
// Update updates the given obj in the Kubernetes cluster. obj must be a // Update updates the given obj in the Kubernetes cluster. obj must be a
// struct pointer so that obj can be updated with the content returned by the Server. // struct pointer so that obj can be updated with the content returned by the Server.
Update(ctx context.Context, obj Object, opts ...UpdateOption) error Update(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error
// Delete deletes the given obj from Kubernetes cluster. // Delete deletes the given obj from Kubernetes cluster.
Delete(ctx context.Context, obj Object, opts ...DeleteOption) error Delete(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error
// Patch patches the given obj in the Kubernetes cluster. obj must be a // Patch patches the given obj in the Kubernetes cluster. obj must be a
// struct pointer so that obj can be updated with the content returned by the Server. // struct pointer so that obj can be updated with the content returned by the Server.
Patch(ctx context.Context, obj Object, patch Patch, opts ...PatchOption) error Patch(ctx context.Context, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error
// IsObjectNamespaced returns true if the GroupVersionKind of the object is namespaced. // IsObjectNamespaced returns true if the GroupVersionKind of the object is namespaced.
IsObjectNamespaced(obj runtime.Object) (bool, error) IsObjectNamespaced(obj runtime.Object) (bool, error)
@ -39,3 +41,8 @@ type Client interface {
// RESTMapper returns the rest this client is using. // RESTMapper returns the rest this client is using.
RESTMapper() meta.RESTMapper RESTMapper() meta.RESTMapper
} }
func New(cfg *rest.Config) (Client, error) {
var opts ctrlclient.Options
return ctrlclient.New(cfg, opts)
}

View File

@ -1,4 +1,4 @@
package simple package client
import ( import (
"testing" "testing"

View File

@ -1,31 +1,28 @@
package dryrun package client
import ( import (
"context" "context"
"github.com/kyverno/chainsaw/pkg/client"
"k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
) )
type Client = client.Client
type dryRunClient struct { type dryRunClient struct {
inner Client inner Client
} }
func (c *dryRunClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error { func (c *dryRunClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error {
return c.inner.Create(ctx, obj, append(opts, ctrlclient.DryRunAll)...) return c.inner.Create(ctx, obj, append(opts, client.DryRunAll)...)
} }
func (c *dryRunClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error { func (c *dryRunClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error {
return c.inner.Update(ctx, obj, append(opts, ctrlclient.DryRunAll)...) return c.inner.Update(ctx, obj, append(opts, client.DryRunAll)...)
} }
func (c *dryRunClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error { func (c *dryRunClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error {
return c.inner.Delete(ctx, obj, append(opts, ctrlclient.DryRunAll)...) return c.inner.Delete(ctx, obj, append(opts, client.DryRunAll)...)
} }
func (c *dryRunClient) Get(ctx context.Context, key types.NamespacedName, obj client.Object, opts ...client.GetOption) error { func (c *dryRunClient) Get(ctx context.Context, key types.NamespacedName, obj client.Object, opts ...client.GetOption) error {
@ -41,13 +38,13 @@ func (c *dryRunClient) List(ctx context.Context, list client.ObjectList, opts ..
} }
func (c *dryRunClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { func (c *dryRunClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error {
return c.inner.Patch(ctx, obj, patch, append(opts, ctrlclient.DryRunAll)...) return c.inner.Patch(ctx, obj, patch, append(opts, client.DryRunAll)...)
} }
func (c *dryRunClient) RESTMapper() meta.RESTMapper { func (c *dryRunClient) RESTMapper() meta.RESTMapper {
return c.inner.RESTMapper() return c.inner.RESTMapper()
} }
func New(inner Client) Client { func DryRun(inner Client) Client {
return &dryRunClient{inner: inner} return &dryRunClient{inner: inner}
} }

View File

@ -1,20 +1,20 @@
package dryrun package client
import ( import (
"context" "context"
"errors" "errors"
"testing" "testing"
"github.com/kyverno/chainsaw/pkg/client"
tclient "github.com/kyverno/chainsaw/pkg/client/testing" tclient "github.com/kyverno/chainsaw/pkg/client/testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
) )
func TestNew(t *testing.T) { func TestDryRun(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
inner Client inner Client
@ -28,7 +28,7 @@ func TestNew(t *testing.T) {
}} }}
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
got := New(tt.inner) got := DryRun(tt.inner)
assert.Equal(t, tt.want, got) assert.Equal(t, tt.want, got)
}) })
} }
@ -61,28 +61,28 @@ func Test_dryRunClient_Create(t *testing.T) {
return nil return nil
} }
inner := &tclient.FakeClient{ inner := &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
CreateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error { CreateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
UpdateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error { UpdateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error { DeleteFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
ListFn: func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error { ListFn: func(ctx context.Context, call int, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
PatchFn: func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { PatchFn: func(ctx context.Context, call int, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) { IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) {
@ -130,28 +130,28 @@ func Test_dryRunClient_Update(t *testing.T) {
return nil return nil
} }
inner := &tclient.FakeClient{ inner := &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
CreateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error { CreateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
UpdateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error { UpdateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error { DeleteFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
ListFn: func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error { ListFn: func(ctx context.Context, call int, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
PatchFn: func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { PatchFn: func(ctx context.Context, call int, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) { IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) {
@ -199,28 +199,28 @@ func Test_dryRunClient_Delete(t *testing.T) {
return nil return nil
} }
inner := &tclient.FakeClient{ inner := &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
CreateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error { CreateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
UpdateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error { UpdateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error { DeleteFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
ListFn: func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error { ListFn: func(ctx context.Context, call int, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
PatchFn: func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { PatchFn: func(ctx context.Context, call int, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) { IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) {
@ -268,28 +268,28 @@ func Test_dryRunClient_Get(t *testing.T) {
return nil return nil
} }
inner := &tclient.FakeClient{ inner := &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
CreateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error { CreateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
UpdateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error { UpdateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error { DeleteFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
ListFn: func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error { ListFn: func(ctx context.Context, call int, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
PatchFn: func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { PatchFn: func(ctx context.Context, call int, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) { IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) {
@ -337,28 +337,28 @@ func Test_dryRunClient_List(t *testing.T) {
return nil return nil
} }
inner := &tclient.FakeClient{ inner := &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
CreateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error { CreateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
UpdateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error { UpdateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error { DeleteFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
ListFn: func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error { ListFn: func(ctx context.Context, call int, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
PatchFn: func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { PatchFn: func(ctx context.Context, call int, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) { IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) {
@ -406,28 +406,28 @@ func Test_dryRunClient_Patch(t *testing.T) {
return nil return nil
} }
inner := &tclient.FakeClient{ inner := &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
CreateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error { CreateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
UpdateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error { UpdateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error { DeleteFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
ListFn: func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error { ListFn: func(ctx context.Context, call int, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
PatchFn: func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { PatchFn: func(ctx context.Context, call int, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) { IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) {
@ -484,28 +484,28 @@ func Test_dryRunClient_IsObjectNamespaced(t *testing.T) {
return nil return nil
} }
inner := &tclient.FakeClient{ inner := &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
CreateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error { CreateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
UpdateFn: func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error { UpdateFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
DeleteFn: func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error { DeleteFn: func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
ListFn: func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error { ListFn: func(ctx context.Context, call int, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error {
assert.NotContains(t, opts, ctrlclient.DryRunAll) assert.NotContains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
PatchFn: func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { PatchFn: func(ctx context.Context, call int, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error {
assert.Contains(t, opts, ctrlclient.DryRunAll) assert.Contains(t, opts, client.DryRunAll)
return wantErr() return wantErr()
}, },
IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) { IsObjectNamespacedFn: func(call int, obj runtime.Object) (bool, error) {

36
pkg/client/key.go Normal file
View File

@ -0,0 +1,36 @@
package client
import (
"fmt"
"github.com/kyverno/pkg/ext/output/color"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
)
func ObjectKey(obj metav1.Object) ctrlclient.ObjectKey {
return ctrlclient.ObjectKey{
Name: obj.GetName(),
Namespace: obj.GetNamespace(),
}
}
func Name(key ctrlclient.ObjectKey) string {
return ColouredName(key, nil)
}
func ColouredName(key ctrlclient.ObjectKey, color *color.Color) string {
sprint := fmt.Sprint
if color != nil {
sprint = color.Sprint
}
name := key.Name
if name == "" {
name = "*"
}
name = sprint(name)
if key.Namespace != "" {
name = sprint(key.Namespace) + "/" + name
}
return name
}

99
pkg/client/key_test.go Normal file
View File

@ -0,0 +1,99 @@
package client
import (
"testing"
"github.com/fatih/color"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
)
func TestObjectKey(t *testing.T) {
obj := &metav1.ObjectMeta{
Name: "test-name",
Namespace: "test-namespace",
}
key := ObjectKey(obj)
assert.Equal(t, "test-name", key.Name)
assert.Equal(t, "test-namespace", key.Namespace)
}
func TestName(t *testing.T) {
key := ctrlclient.ObjectKey{Name: "test-name"}
name := Name(key)
assert.Equal(t, "test-name", name)
key.Namespace = "test-namespace"
name = Name(key)
assert.Equal(t, "test-namespace/test-name", name)
key = ctrlclient.ObjectKey{}
name = Name(key)
assert.Equal(t, "*", name)
}
func TestColouredName(t *testing.T) {
disabled := color.New(color.FgBlue)
disabled.DisableColor()
enabled := color.New(color.FgBlue)
enabled.EnableColor()
tests := []struct {
name string
key ctrlclient.ObjectKey
color *color.Color
want string
}{{
name: "empty",
key: ctrlclient.ObjectKey{},
color: nil,
want: "*",
}, {
name: "name only",
key: ctrlclient.ObjectKey{Name: "test-name"},
color: nil,
want: "test-name",
}, {
name: "name and namespace",
key: ctrlclient.ObjectKey{Name: "test-name", Namespace: "test-namespace"},
color: nil,
want: "test-namespace/test-name",
}, {
name: "empty",
key: ctrlclient.ObjectKey{},
color: disabled,
want: "*",
}, {
name: "name only",
key: ctrlclient.ObjectKey{Name: "test-name"},
color: disabled,
want: "test-name",
}, {
name: "name and namespace",
key: ctrlclient.ObjectKey{Name: "test-name", Namespace: "test-namespace"},
color: disabled,
want: "test-namespace/test-name",
}, {
name: "empty",
key: ctrlclient.ObjectKey{},
color: enabled,
want: "\x1b[34m*\x1b[0m",
}, {
name: "name only",
key: ctrlclient.ObjectKey{Name: "test-name"},
color: enabled,
want: "\x1b[34mtest-name\x1b[0m",
}, {
name: "name and namespace",
key: ctrlclient.ObjectKey{Name: "test-name", Namespace: "test-namespace"},
color: enabled,
want: "\x1b[34mtest-namespace\x1b[0m/\x1b[34mtest-name\x1b[0m",
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := ColouredName(tt.key, tt.color)
assert.Equal(t, tt.want, got)
})
}
}

View File

@ -1,4 +1,4 @@
package kube package client
import ( import (
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
@ -16,3 +16,7 @@ func Namespace(name string) corev1.Namespace {
}, },
} }
} }
func PetNamespace() corev1.Namespace {
return Namespace(Pet())
}

View File

@ -1,4 +1,4 @@
package kube package client
import ( import (
"testing" "testing"
@ -10,7 +10,14 @@ import (
func TestNamespace(t *testing.T) { func TestNamespace(t *testing.T) {
expectedName := "testNamespace" expectedName := "testNamespace"
ns := Namespace(expectedName) ns := Namespace(expectedName)
assert.Equal(t, corev1.SchemeGroupVersion.String(), ns.APIVersion) assert.Equal(t, corev1.SchemeGroupVersion.String(), ns.APIVersion)
assert.Equal(t, "Namespace", ns.Kind) assert.Equal(t, "Namespace", ns.Kind)
assert.Equal(t, expectedName, ns.Name) assert.Equal(t, expectedName, ns.Name)
} }
func TestPetNamespace(t *testing.T) {
ns := PetNamespace()
assert.NotEmpty(t, ns.Name)
}

25
pkg/client/patch.go Normal file
View File

@ -0,0 +1,25 @@
package client
import (
"errors"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
)
func PatchObject(actual, expected runtime.Object) (runtime.Object, error) {
if actual == nil || expected == nil {
return nil, errors.New("actual and expected objects must not be nil")
}
actualMeta, err := meta.Accessor(actual)
if err != nil {
return nil, err
}
copy := expected.DeepCopyObject()
expectedMeta, err := meta.Accessor(copy)
if err != nil {
return nil, err
}
expectedMeta.SetResourceVersion(actualMeta.GetResourceVersion())
return copy, nil
}

84
pkg/client/patch_test.go Normal file
View File

@ -0,0 +1,84 @@
package client
import (
"testing"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
truntime "k8s.io/apimachinery/pkg/runtime/testing"
)
func TestPatchObject(t *testing.T) {
tests := []struct {
name string
actual runtime.Object
expected runtime.Object
want runtime.Object
wantErr bool
}{{
name: "acutal nil",
actual: nil,
expected: &unstructured.Unstructured{},
wantErr: true,
}, {
name: "expected nil",
actual: &unstructured.Unstructured{},
expected: nil,
wantErr: true,
}, {
name: "ok",
actual: &unstructured.Unstructured{
Object: map[string]any{
"apiVersion": "v1",
"kind": "Pod",
"metadata": map[string]any{
"name": "test-pod",
"resourceVersion": "12345",
},
},
},
expected: &unstructured.Unstructured{
Object: map[string]any{
"apiVersion": "v1",
"kind": "Pod",
"metadata": map[string]any{
"name": "test-pod",
},
"foo": "bar",
},
},
want: &unstructured.Unstructured{
Object: map[string]any{
"apiVersion": "v1",
"kind": "Pod",
"metadata": map[string]any{
"name": "test-pod",
"resourceVersion": "12345",
},
"foo": "bar",
},
},
}, {
name: "actual not meta",
actual: &truntime.InternalSimple{},
expected: &unstructured.Unstructured{},
wantErr: true,
}, {
name: "expected not meta",
actual: &unstructured.Unstructured{},
expected: &truntime.InternalSimple{},
wantErr: true,
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := PatchObject(tt.actual, tt.expected)
if tt.wantErr {
assert.Error(t, err)
} else {
assert.NoError(t, err)
assert.Equal(t, tt.want, got)
}
})
}
}

11
pkg/client/pet.go Normal file
View File

@ -0,0 +1,11 @@
package client
import (
"fmt"
petname "github.com/dustinkirkland/golang-petname"
)
func Pet() string {
return fmt.Sprintf("chainsaw-%s", petname.Generate(2, "-"))
}

View File

@ -1,17 +0,0 @@
package simple
import (
"github.com/kyverno/chainsaw/pkg/client"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/rest"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
)
func New(cfg *rest.Config) (client.Client, error) {
var opts ctrlclient.Options
client, err := ctrlclient.New(cfg, opts)
if err != nil {
return nil, err
}
return ctrlclient.WithFieldValidation(client, metav1.FieldValidationStrict), nil
}

View File

@ -5,48 +5,48 @@ import (
"k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
client "sigs.k8s.io/controller-runtime/pkg/client" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
) )
// TODO: not thread safe // TODO: not thread safe
type FakeClient struct { type FakeClient struct {
GetFn func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error GetFn func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error
CreateFn func(ctx context.Context, call int, obj client.Object, opts ...client.CreateOption) error CreateFn func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error
UpdateFn func(ctx context.Context, call int, obj client.Object, opts ...client.UpdateOption) error UpdateFn func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error
DeleteFn func(ctx context.Context, call int, obj client.Object, opts ...client.DeleteOption) error DeleteFn func(ctx context.Context, call int, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error
ListFn func(ctx context.Context, call int, list client.ObjectList, opts ...client.ListOption) error ListFn func(ctx context.Context, call int, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error
PatchFn func(ctx context.Context, call int, obj client.Object, patch client.Patch, opts ...client.PatchOption) error PatchFn func(ctx context.Context, call int, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error
IsObjectNamespacedFn func(call int, obj runtime.Object) (bool, error) IsObjectNamespacedFn func(call int, obj runtime.Object) (bool, error)
RESTMapperFn func(call int) meta.RESTMapper RESTMapperFn func(call int) meta.RESTMapper
numCalls int numCalls int
} }
func (c *FakeClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { func (c *FakeClient) Get(ctx context.Context, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
defer func() { c.numCalls++ }() defer func() { c.numCalls++ }()
return c.GetFn(ctx, c.numCalls, key, obj, opts...) return c.GetFn(ctx, c.numCalls, key, obj, opts...)
} }
func (c *FakeClient) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error { func (c *FakeClient) List(ctx context.Context, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error {
defer func() { c.numCalls++ }() defer func() { c.numCalls++ }()
return c.ListFn(ctx, c.numCalls, list, opts...) return c.ListFn(ctx, c.numCalls, list, opts...)
} }
func (c *FakeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error { func (c *FakeClient) Create(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error {
defer func() { c.numCalls++ }() defer func() { c.numCalls++ }()
return c.CreateFn(ctx, c.numCalls, obj, opts...) return c.CreateFn(ctx, c.numCalls, obj, opts...)
} }
func (c *FakeClient) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error { func (c *FakeClient) Update(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error {
defer func() { c.numCalls++ }() defer func() { c.numCalls++ }()
return c.UpdateFn(ctx, c.numCalls, obj, opts...) return c.UpdateFn(ctx, c.numCalls, obj, opts...)
} }
func (c *FakeClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error { func (c *FakeClient) Delete(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error {
defer func() { c.numCalls++ }() defer func() { c.numCalls++ }()
return c.DeleteFn(ctx, c.numCalls, obj, opts...) return c.DeleteFn(ctx, c.numCalls, obj, opts...)
} }
func (c *FakeClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error { func (c *FakeClient) Patch(ctx context.Context, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error {
defer func() { c.numCalls++ }() defer func() { c.numCalls++ }()
return c.PatchFn(ctx, c.numCalls, obj, patch, opts...) return c.PatchFn(ctx, c.numCalls, obj, patch, opts...)
} }

View File

@ -1,23 +0,0 @@
package client
import (
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
)
type (
Object = ctrlclient.Object
ObjectKey = ctrlclient.ObjectKey
ObjectList = ctrlclient.ObjectList
Patch = ctrlclient.Patch
GetOption = ctrlclient.GetOption
ListOption = ctrlclient.ListOption
CreateOption = ctrlclient.CreateOption
UpdateOption = ctrlclient.UpdateOption
DeleteOption = ctrlclient.DeleteOption
PatchOption = ctrlclient.PatchOption
InNamespace = ctrlclient.InNamespace
PropagationPolicy = ctrlclient.PropagationPolicy
MatchingLabels = ctrlclient.MatchingLabels
)
var RawPatch = ctrlclient.RawPatch

View File

@ -1,4 +1,4 @@
package kube package client
import ( import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

View File

@ -1,4 +1,4 @@
package kube package client
import ( import (
"testing" "testing"

View File

@ -1,74 +0,0 @@
package client
import (
"context"
"errors"
"fmt"
"time"
"github.com/kyverno/pkg/ext/output/color"
kerrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
)
const PollInterval = 50 * time.Millisecond
func Key(obj metav1.Object) ObjectKey {
return ObjectKey{
Name: obj.GetName(),
Namespace: obj.GetNamespace(),
}
}
func Name(key ObjectKey) string {
return ColouredName(key, nil)
}
func ColouredName(key ObjectKey, color *color.Color) string {
sprint := fmt.Sprint
if color != nil {
sprint = color.Sprint
}
name := key.Name
if name == "" {
name = "*"
}
name = sprint(name)
if key.Namespace != "" {
name = sprint(key.Namespace) + "/" + name
}
return name
}
func PatchObject(actual, expected runtime.Object) (runtime.Object, error) {
if actual == nil || expected == nil {
return nil, errors.New("actual and expected objects must not be nil")
}
actualMeta, err := meta.Accessor(actual)
if err != nil {
return nil, err
}
copy := expected.DeepCopyObject()
expectedMeta, err := meta.Accessor(copy)
if err != nil {
return nil, err
}
expectedMeta.SetResourceVersion(actualMeta.GetResourceVersion())
return copy, nil
}
func WaitForDeletion(ctx context.Context, client Client, object Object) error {
key := Key(object)
return wait.PollUntilContextCancel(ctx, PollInterval, true, func(ctx context.Context) (bool, error) {
if err := client.Get(ctx, key, object); err != nil {
if kerrors.IsNotFound(err) {
return true, nil
}
return false, err
}
return false, nil
})
}

View File

@ -1,235 +0,0 @@
package client
import (
"context"
"errors"
"testing"
"time"
"github.com/fatih/color"
tclient "github.com/kyverno/chainsaw/pkg/client/testing"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
kerror "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
truntime "k8s.io/apimachinery/pkg/runtime/testing"
)
func TestObjectKey(t *testing.T) {
obj := &metav1.ObjectMeta{
Name: "test-name",
Namespace: "test-namespace",
}
key := Key(obj)
assert.Equal(t, "test-name", key.Name)
assert.Equal(t, "test-namespace", key.Namespace)
}
func TestName(t *testing.T) {
key := ObjectKey{Name: "test-name"}
name := Name(key)
assert.Equal(t, "test-name", name)
key.Namespace = "test-namespace"
name = Name(key)
assert.Equal(t, "test-namespace/test-name", name)
key = ObjectKey{}
name = Name(key)
assert.Equal(t, "*", name)
}
func TestColouredName(t *testing.T) {
disabled := color.New(color.FgBlue)
disabled.DisableColor()
enabled := color.New(color.FgBlue)
enabled.EnableColor()
tests := []struct {
name string
key ObjectKey
color *color.Color
want string
}{{
name: "empty",
key: ObjectKey{},
color: nil,
want: "*",
}, {
name: "name only",
key: ObjectKey{Name: "test-name"},
color: nil,
want: "test-name",
}, {
name: "name and namespace",
key: ObjectKey{Name: "test-name", Namespace: "test-namespace"},
color: nil,
want: "test-namespace/test-name",
}, {
name: "empty",
key: ObjectKey{},
color: disabled,
want: "*",
}, {
name: "name only",
key: ObjectKey{Name: "test-name"},
color: disabled,
want: "test-name",
}, {
name: "name and namespace",
key: ObjectKey{Name: "test-name", Namespace: "test-namespace"},
color: disabled,
want: "test-namespace/test-name",
}, {
name: "empty",
key: ObjectKey{},
color: enabled,
want: "\x1b[34m*\x1b[0m",
}, {
name: "name only",
key: ObjectKey{Name: "test-name"},
color: enabled,
want: "\x1b[34mtest-name\x1b[0m",
}, {
name: "name and namespace",
key: ObjectKey{Name: "test-name", Namespace: "test-namespace"},
color: enabled,
want: "\x1b[34mtest-namespace\x1b[0m/\x1b[34mtest-name\x1b[0m",
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := ColouredName(tt.key, tt.color)
assert.Equal(t, tt.want, got)
})
}
}
func TestPatchObject(t *testing.T) {
tests := []struct {
name string
actual runtime.Object
expected runtime.Object
want runtime.Object
wantErr bool
}{{
name: "acutal nil",
actual: nil,
expected: &unstructured.Unstructured{},
wantErr: true,
}, {
name: "expected nil",
actual: &unstructured.Unstructured{},
expected: nil,
wantErr: true,
}, {
name: "ok",
actual: &unstructured.Unstructured{
Object: map[string]any{
"apiVersion": "v1",
"kind": "Pod",
"metadata": map[string]any{
"name": "test-pod",
"resourceVersion": "12345",
},
},
},
expected: &unstructured.Unstructured{
Object: map[string]any{
"apiVersion": "v1",
"kind": "Pod",
"metadata": map[string]any{
"name": "test-pod",
},
"foo": "bar",
},
},
want: &unstructured.Unstructured{
Object: map[string]any{
"apiVersion": "v1",
"kind": "Pod",
"metadata": map[string]any{
"name": "test-pod",
"resourceVersion": "12345",
},
"foo": "bar",
},
},
}, {
name: "actual not meta",
actual: &truntime.InternalSimple{},
expected: &unstructured.Unstructured{},
wantErr: true,
}, {
name: "expected not meta",
actual: &unstructured.Unstructured{},
expected: &truntime.InternalSimple{},
wantErr: true,
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := PatchObject(tt.actual, tt.expected)
if tt.wantErr {
assert.Error(t, err)
} else {
assert.NoError(t, err)
assert.Equal(t, tt.want, got)
}
})
}
}
func TestWaitForDeletion(t *testing.T) {
obj := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
}
tests := []struct {
name string
object Object
client Client
wantErr bool
}{{
name: "ok",
object: obj,
client: &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key ObjectKey, obj Object, opts ...GetOption) error {
return kerror.NewNotFound(corev1.Resource("namespace"), "foo")
},
},
wantErr: false,
}, {
name: "error",
object: obj,
client: &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key ObjectKey, obj Object, opts ...GetOption) error {
return errors.New("dummy")
},
},
wantErr: true,
}, {
name: "timeout",
object: obj,
client: &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key ObjectKey, obj Object, opts ...GetOption) error {
return nil
},
},
wantErr: true,
}}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ctx := context.TODO()
ctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()
err := WaitForDeletion(ctx, tt.client, tt.object)
if tt.wantErr {
assert.Error(t, err)
} else {
assert.NoError(t, err)
}
})
}
}

View File

@ -6,15 +6,13 @@ import (
"io" "io"
"time" "time"
"github.com/kyverno/chainsaw/pkg/apis" "github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
"github.com/kyverno/chainsaw/pkg/client" ctrlClient "github.com/kyverno/chainsaw/pkg/client"
"github.com/kyverno/chainsaw/pkg/client/simple"
tclient "github.com/kyverno/chainsaw/pkg/client/testing" tclient "github.com/kyverno/chainsaw/pkg/client/testing"
engineclient "github.com/kyverno/chainsaw/pkg/engine/client" "github.com/kyverno/chainsaw/pkg/resource"
nspacer "github.com/kyverno/chainsaw/pkg/engine/namespacer" runnerclient "github.com/kyverno/chainsaw/pkg/runner/client"
opassert "github.com/kyverno/chainsaw/pkg/engine/operations/assert" nspacer "github.com/kyverno/chainsaw/pkg/runner/namespacer"
"github.com/kyverno/chainsaw/pkg/loaders/config" opassert "github.com/kyverno/chainsaw/pkg/runner/operations/assert"
"github.com/kyverno/chainsaw/pkg/loaders/resource"
restutils "github.com/kyverno/chainsaw/pkg/utils/rest" restutils "github.com/kyverno/chainsaw/pkg/utils/rest"
"github.com/kyverno/pkg/ext/output/color" "github.com/kyverno/pkg/ext/output/color"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -48,13 +46,9 @@ func Command() *cobra.Command {
return runE(opts, cmd, nil, nil) return runE(opts, cmd, nil, nil)
}, },
} }
config, err := config.DefaultConfiguration()
if err != nil {
panic(err)
}
cmd.Flags().StringVarP(&opts.assertPath, "file", "f", "", "Path to the file to assert or '-' to read from stdin") cmd.Flags().StringVarP(&opts.assertPath, "file", "f", "", "Path to the file to assert or '-' to read from stdin")
cmd.Flags().StringVarP(&opts.resourcePath, "resource", "r", "", "Path to the file containing the resource") cmd.Flags().StringVarP(&opts.resourcePath, "resource", "r", "", "Path to the file containing the resource")
cmd.Flags().DurationVar(&opts.timeout.Duration, "timeout", config.Spec.Timeouts.Assert.Duration, "The assert timeout to use") cmd.Flags().DurationVar(&opts.timeout.Duration, "timeout", v1alpha1.DefaultAssertTimeout, "The assert timeout to use")
cmd.Flags().StringVar(&opts.namespace, "namespace", "default", "Namespace to use") cmd.Flags().StringVar(&opts.namespace, "namespace", "default", "Namespace to use")
cmd.Flags().BoolVar(&opts.noColor, "no-color", false, "Removes output colors") cmd.Flags().BoolVar(&opts.noColor, "no-color", false, "Removes output colors")
cmd.Flags().BoolVar(&opts.noColor, "clustered", false, "Defines if the resource is clustered (only applies when resource is loaded from a file)") cmd.Flags().BoolVar(&opts.noColor, "clustered", false, "Defines if the resource is clustered (only applies when resource is loaded from a file)")
@ -71,7 +65,7 @@ func preRunE(opts *options, _ *cobra.Command, args []string) error {
return nil return nil
} }
func runE(opts options, cmd *cobra.Command, client client.Client, namespacer nspacer.Namespacer) error { func runE(opts options, cmd *cobra.Command, client ctrlClient.Client, namespacer nspacer.Namespacer) error {
color.Init(opts.noColor, true) color.Init(opts.noColor, true)
out := cmd.OutOrStdout() out := cmd.OutOrStdout()
var assertions []unstructured.Unstructured var assertions []unstructured.Unstructured
@ -119,14 +113,14 @@ func runE(opts options, cmd *cobra.Command, client client.Client, namespacer nsp
if err != nil { if err != nil {
return err return err
} }
newClient, err := simple.New(cfg) newClient, err := ctrlClient.New(cfg)
if err != nil { if err != nil {
return err return err
} }
client = engineclient.New(newClient) client = runnerclient.New(newClient)
} }
if namespacer == nil { if namespacer == nil {
namespacer = nspacer.New(opts.namespace) namespacer = nspacer.New(client, opts.namespace)
} }
for _, assertion := range assertions { for _, assertion := range assertions {
if err := assert(opts, client, assertion, namespacer); err != nil { if err := assert(opts, client, assertion, namespacer); err != nil {
@ -137,14 +131,10 @@ func runE(opts options, cmd *cobra.Command, client client.Client, namespacer nsp
return nil return nil
} }
func assert(opts options, client client.Client, resource unstructured.Unstructured, namespacer nspacer.Namespacer) error { func assert(opts options, client ctrlClient.Client, resource unstructured.Unstructured, namespacer nspacer.Namespacer) error {
ctx := context.Background() ctx, cancel := context.WithTimeout(context.Background(), opts.timeout.Duration)
if opts.timeout.Duration != 0 { defer cancel()
_ctx, cancel := context.WithTimeout(ctx, opts.timeout.Duration) op := opassert.New(client, resource, namespacer, false)
defer cancel()
ctx = _ctx
}
op := opassert.New(apis.DefaultCompilers, client, resource, namespacer, false)
_, err := op.Exec(ctx, nil) _, err := op.Exec(ctx, nil)
return err return err
} }

View File

@ -3,30 +3,23 @@ package assert
import ( import (
"bytes" "bytes"
"context" "context"
"errors"
"io" "io"
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
"testing"
"time" "time"
"github.com/kyverno/chainsaw/pkg/client"
tclient "github.com/kyverno/chainsaw/pkg/client/testing" tclient "github.com/kyverno/chainsaw/pkg/client/testing"
"github.com/kyverno/chainsaw/pkg/commands/root" "github.com/kyverno/chainsaw/pkg/commands/root"
fakeNamespacer "github.com/kyverno/chainsaw/pkg/engine/namespacer/testing" fakeNamespacer "github.com/kyverno/chainsaw/pkg/runner/namespacer/testing"
"github.com/kyverno/chainsaw/pkg/testing"
"github.com/spf13/cobra" "github.com/spf13/cobra"
testify "github.com/stretchr/testify/assert" testify "github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
) )
type errReader struct{}
func (e *errReader) Read(p []byte) (n int, err error) {
return 0, errors.New("error reading from stdin")
}
func Test_Execute(t *testing.T) { func Test_Execute(t *testing.T) {
basePath := path.Join("..", "..", "..", "testdata", "commands", "assert") basePath := path.Join("..", "..", "..", "testdata", "commands", "assert")
tests := []struct { tests := []struct {
@ -157,7 +150,7 @@ func Test_runE(t *testing.T) {
timeout: metav1.Duration{Duration: 5 * time.Second}, timeout: metav1.Duration{Duration: 5 * time.Second},
}, },
client: &tclient.FakeClient{ client: &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
obj.(*unstructured.Unstructured).Object = map[string]any{ obj.(*unstructured.Unstructured).Object = map[string]any{
"apiVersion": "v1", "apiVersion": "v1",
"kind": "ConfigMap", "kind": "ConfigMap",
@ -172,7 +165,7 @@ func Test_runE(t *testing.T) {
}, },
}, },
nspacer: &fakeNamespacer.FakeNamespacer{ nspacer: &fakeNamespacer.FakeNamespacer{
ApplyFn: func(call int, client client.Client, obj client.Object) error { ApplyFn: func(obj ctrlclient.Object, call int) error {
return nil return nil
}, },
GetNamespaceFn: func(call int) string { GetNamespaceFn: func(call int) string {
@ -196,7 +189,7 @@ func Test_runE(t *testing.T) {
timeout: metav1.Duration{Duration: 5 * time.Second}, timeout: metav1.Duration{Duration: 5 * time.Second},
}, },
client: &tclient.FakeClient{ client: &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
obj.(*unstructured.Unstructured).Object = map[string]any{ obj.(*unstructured.Unstructured).Object = map[string]any{
"apiVersion": "v1", "apiVersion": "v1",
"kind": "ConfigMap", "kind": "ConfigMap",
@ -211,7 +204,7 @@ func Test_runE(t *testing.T) {
}, },
}, },
nspacer: &fakeNamespacer.FakeNamespacer{ nspacer: &fakeNamespacer.FakeNamespacer{
ApplyFn: func(call int, client client.Client, obj client.Object) error { ApplyFn: func(obj ctrlclient.Object, call int) error {
return nil return nil
}, },
GetNamespaceFn: func(call int) string { GetNamespaceFn: func(call int) string {
@ -222,7 +215,7 @@ func Test_runE(t *testing.T) {
"------------------------\n" + "------------------------\n" +
"v1/ConfigMap/quick-start\n" + "v1/ConfigMap/quick-start\n" +
"------------------------\n" + "------------------------\n" +
"* data.foo: Required value: field not found in the input object\n\n" + "* data.foo: Invalid value: \"null\": Expected value: \"bar\"\n\n" +
"--- expected\n" + "--- expected\n" +
"+++ actual\n" + "+++ actual\n" +
"@@ -1,6 +1,5 @@\n" + "@@ -1,6 +1,5 @@\n" +
@ -250,7 +243,7 @@ func Test_runE(t *testing.T) {
timeout: metav1.Duration{Duration: 5 * time.Second}, timeout: metav1.Duration{Duration: 5 * time.Second},
}, },
client: &tclient.FakeClient{ client: &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
obj.(*unstructured.Unstructured).Object = map[string]any{ obj.(*unstructured.Unstructured).Object = map[string]any{
"apiVersion": "v1", "apiVersion": "v1",
"kind": "ConfigMap", "kind": "ConfigMap",
@ -265,7 +258,7 @@ func Test_runE(t *testing.T) {
}, },
}, },
nspacer: &fakeNamespacer.FakeNamespacer{ nspacer: &fakeNamespacer.FakeNamespacer{
ApplyFn: func(call int, client client.Client, obj client.Object) error { ApplyFn: func(obj ctrlclient.Object, call int) error {
return nil return nil
}, },
GetNamespaceFn: func(call int) string { GetNamespaceFn: func(call int) string {
@ -297,7 +290,7 @@ data:
timeout: metav1.Duration{Duration: 5 * time.Second}, timeout: metav1.Duration{Duration: 5 * time.Second},
}, },
client: &tclient.FakeClient{ client: &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
obj.(*unstructured.Unstructured).Object = map[string]any{ obj.(*unstructured.Unstructured).Object = map[string]any{
"apiVersion": "v1", "apiVersion": "v1",
"kind": "ConfigMap", "kind": "ConfigMap",
@ -312,7 +305,7 @@ data:
}, },
}, },
nspacer: &fakeNamespacer.FakeNamespacer{ nspacer: &fakeNamespacer.FakeNamespacer{
ApplyFn: func(call int, client client.Client, obj client.Object) error { ApplyFn: func(obj ctrlclient.Object, call int) error {
return nil return nil
}, },
GetNamespaceFn: func(call int) string { GetNamespaceFn: func(call int) string {
@ -327,7 +320,7 @@ data:
cmd.Args = cobra.RangeArgs(0, 1) cmd.Args = cobra.RangeArgs(0, 1)
cmd.SilenceUsage = true cmd.SilenceUsage = true
cmd.SetOut(bytes.NewBufferString("")) cmd.SetOut(bytes.NewBufferString(""))
cmd.SetIn(&errReader{}) cmd.SetIn(&testing.ErrReader{})
return cmd return cmd
}, },
opts: options{ opts: options{
@ -337,7 +330,7 @@ data:
timeout: metav1.Duration{Duration: 5 * time.Second}, timeout: metav1.Duration{Duration: 5 * time.Second},
}, },
client: &tclient.FakeClient{ client: &tclient.FakeClient{
GetFn: func(ctx context.Context, call int, key client.ObjectKey, obj client.Object, opts ...client.GetOption) error { GetFn: func(ctx context.Context, call int, key ctrlclient.ObjectKey, obj ctrlclient.Object, opts ...ctrlclient.GetOption) error {
obj.(*unstructured.Unstructured).Object = map[string]any{ obj.(*unstructured.Unstructured).Object = map[string]any{
"apiVersion": "v1", "apiVersion": "v1",
"kind": "ConfigMap", "kind": "ConfigMap",
@ -352,7 +345,7 @@ data:
}, },
}, },
nspacer: &fakeNamespacer.FakeNamespacer{ nspacer: &fakeNamespacer.FakeNamespacer{
ApplyFn: func(call int, client client.Client, obj client.Object) error { ApplyFn: func(obj ctrlclient.Object, call int) error {
return nil return nil
}, },
GetNamespaceFn: func(call int) string { GetNamespaceFn: func(call int) string {

View File

@ -1,4 +1,4 @@
# Tests catalog # Tests catalog
{{ range .Tests }} {{ range .Tests }}
- [{{ .Test.Name }}]({{ fpRel $.BasePath (fpJoin .BasePath $.Readme) }}) - [{{ .ObjectMeta.Name }}]({{ fpRel $.BasePath (fpJoin .BasePath $.Readme) }})
{{- end }} {{- end }}

View File

@ -9,20 +9,10 @@ command
create create
{{- else if .Delete -}} {{- else if .Delete -}}
delete delete
{{- else if .Describe -}}
describe
{{- else if .Error -}} {{- else if .Error -}}
error error
{{- else if .Events -}}
events
{{- else if .Get -}}
get
{{- else if .Patch -}} {{- else if .Patch -}}
patch patch
{{- else if .PodLogs -}}
pod logs
{{- else if .Proxy -}}
proxy
{{- else if .Script -}} {{- else if .Script -}}
script script
{{- else if .Sleep -}} {{- else if .Sleep -}}
@ -87,11 +77,11 @@ wait
{{- range . }} {{- range . }}
{{- $test := . -}} {{- $test := . -}}
# Test: `{{ .Test.Name }}` # Test: `{{ .Name }}`
{{ default "*No description*" .Test.Spec.Description }} {{ default "*No description*" .Spec.Description }}
{{- with .Test.Spec.Bindings }} {{- with .Spec.Bindings }}
## Bindings ## Bindings
@ -105,17 +95,17 @@ wait
## Steps ## Steps
{{- with .Test.Spec.Steps }} {{- with .Spec.Steps }}
| # | Name | Bindings | Try | Catch | Finally | Cleanup | | # | Name | Bindings | Try | Catch | Finally | Cleanup |
|:-:|---|:-:|:-:|:-:|:-:|:-:| |:-:|---|:-:|:-:|:-:|:-:|
{{- range $i, $step := . }} {{- range $i, $step := . }}
{{- $name := default (print "step-" (add $i 1)) $step.Name }} {{- $name := default (print "step-" (add $i 1)) $step.Name }}
| {{ add $i 1 }} | [{{ $name }}](#step-{{ $name }}) | {{ len $step.Bindings }} | {{ len $step.Try }} | {{ add (len $step.Catch) (len $test.Test.Spec.Catch) }} | {{ len $step.Finally }} | {{ len $step.Cleanup }} | | {{ add $i 1 }} | [{{ $name }}](#step-{{ $name }}) | {{ len $step.Bindings }} | {{ len $step.Try }} | {{ add (len $step.Catch) (len $test.Spec.Catch) }} | {{ len $step.Finally }} | {{ len $step.Cleanup }} |
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- range $i, $step := .Test.Spec.Steps }} {{- range $i, $step := .Spec.Steps }}
{{- $name := default (print "step-" (add $i 1)) $step.Name }} {{- $name := default (print "step-" (add $i 1)) $step.Name }}
### Step: `{{ $name }}` ### Step: `{{ $name }}`
@ -151,11 +141,11 @@ wait
| # | Operation | Bindings | Outputs | Description | | # | Operation | Bindings | Outputs | Description |
|:-:|---|:-:|:-:|---| |:-:|---|:-:|:-:|---|
{{- range $i, $op := $test.Test.Spec.Catch }} {{- range $i, $op := $test.Spec.Catch }}
| {{ add $i 1 }} | `{{ template "CatchType" $op }}` | {{ len $op.Bindings }} | {{ len $op.Outputs }} | {{ default "*No description*" $op.Description }} | | {{ add $i 1 }} | `{{ template "CatchType" $op }}` | {{ len $op.Bindings }} | {{ len $op.Outputs }} | {{ default "*No description*" $op.Description }} |
{{- end }} {{- end }}
{{- range $i, $op := . }} {{- range $i, $op := . }}
| {{ add (len $test.Test.Spec.Catch) $i 1 }} | `{{ template "CatchType" $op }}` | {{ len $op.Bindings }} | {{ len $op.Outputs }} | {{ default "*No description*" $op.Description }} | | {{ add (len $test.Spec.Catch) $i 1 }} | `{{ template "CatchType" $op }}` | {{ len $op.Bindings }} | {{ len $op.Outputs }} | {{ default "*No description*" $op.Description }} |
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -19,7 +19,7 @@ func websitePrepender(filename string) string {
now := time.Now().Format(time.RFC3339) now := time.Now().Format(time.RFC3339)
name := filepath.Base(filename) name := filepath.Base(filename)
base := strings.TrimSuffix(name, path.Ext(name)) base := strings.TrimSuffix(name, path.Ext(name))
return fmt.Sprintf(fmTemplate, now, strings.ReplaceAll(base, "_", " ")) return fmt.Sprintf(fmTemplate, now, strings.Replace(base, "_", " ", -1))
} }
func websiteLinkHandler(filename string) string { func websiteLinkHandler(filename string) string {

Some files were not shown because too many files have changed in this diff Show More