-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate more kuttl tests to chainsaw
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
- Loading branch information
1 parent
4a3180d
commit cf4800a
Showing
220 changed files
with
1,147 additions
and
744 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...te-flux-multi-tenant-resources/03-ns.yaml → ...ainsaw-test/chainsaw-step-03-apply-1.yaml
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: flux-tenant-namespace | ||
labels: | ||
toolkit.fluxcd.io/tenant: ftenant | ||
toolkit.fluxcd.io/tenant: ftenant | ||
name: flux-tenant-namespace |
29 changes: 29 additions & 0 deletions
29
flux/generate-flux-multi-tenant-resources/.chainsaw-test/chainsaw-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
creationTimestamp: null | ||
name: generate-flux-multi-tenant-resources | ||
spec: | ||
steps: | ||
- name: step-01 | ||
try: | ||
- apply: | ||
file: ns.yaml | ||
- apply: | ||
file: cluster-role.yaml | ||
- name: step-02 | ||
try: | ||
- apply: | ||
file: ../generate-flux-multi-tenant-resources.yaml | ||
- assert: | ||
file: policy-ready.yaml | ||
- name: step-03 | ||
try: | ||
- apply: | ||
file: chainsaw-step-03-apply-1.yaml | ||
- name: step-04 | ||
try: | ||
- assert: | ||
file: generatedResources.yaml | ||
- error: | ||
file: notGeneratedResource.yaml |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
flux/verify-flux-sources/.chainsaw-test/chainsaw-step-01-assert-1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: verify-flux-sources | ||
status: | ||
ready: true |
13 changes: 13 additions & 0 deletions
13
flux/verify-flux-sources/.chainsaw-test/chainsaw-step-01-assert-2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: buckets.source.toolkit.fluxcd.io | ||
spec: {} | ||
status: | ||
acceptedNames: | ||
kind: Bucket | ||
listKind: BucketList | ||
plural: buckets | ||
singular: bucket | ||
storedVersions: | ||
- v1beta2 |
13 changes: 13 additions & 0 deletions
13
flux/verify-flux-sources/.chainsaw-test/chainsaw-step-01-assert-3.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: gitrepositories.source.toolkit.fluxcd.io | ||
spec: {} | ||
status: | ||
acceptedNames: | ||
kind: GitRepository | ||
listKind: GitRepositoryList | ||
plural: gitrepositories | ||
singular: gitrepository | ||
storedVersions: | ||
- v1 |
13 changes: 13 additions & 0 deletions
13
flux/verify-flux-sources/.chainsaw-test/chainsaw-step-01-assert-4.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: imagerepositories.image.toolkit.fluxcd.io | ||
spec: {} | ||
status: | ||
acceptedNames: | ||
kind: ImageRepository | ||
listKind: ImageRepositoryList | ||
plural: imagerepositories | ||
singular: imagerepository | ||
storedVersions: | ||
- v1beta2 |
13 changes: 13 additions & 0 deletions
13
flux/verify-flux-sources/.chainsaw-test/chainsaw-step-01-assert-5.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: helmrepositories.source.toolkit.fluxcd.io | ||
spec: {} | ||
status: | ||
acceptedNames: | ||
kind: HelmRepository | ||
listKind: HelmRepositoryList | ||
plural: helmrepositories | ||
singular: helmrepository | ||
storedVersions: | ||
- v1beta2 |
2 changes: 1 addition & 1 deletion
2
istio/create-authorizationpolicy/05-ns.yaml → ...ainsaw-test/chainsaw-step-02-apply-1.yaml
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: istio-cr-authpol-ns | ||
name: flux-system |
63 changes: 63 additions & 0 deletions
63
flux/verify-flux-sources/.chainsaw-test/chainsaw-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
creationTimestamp: null | ||
name: verify-flux-sources | ||
spec: | ||
steps: | ||
- name: step-01 | ||
try: | ||
- script: | ||
content: | | ||
sed 's/validationFailureAction: audit/validationFailureAction: Enforce/' ../verify-flux-sources.yaml | kubectl create -f - | ||
- assert: | ||
file: chainsaw-step-01-assert-1.yaml | ||
- assert: | ||
file: chainsaw-step-01-assert-2.yaml | ||
- assert: | ||
file: chainsaw-step-01-assert-3.yaml | ||
- assert: | ||
file: chainsaw-step-01-assert-4.yaml | ||
- assert: | ||
file: chainsaw-step-01-assert-5.yaml | ||
- name: step-02 | ||
try: | ||
- apply: | ||
file: chainsaw-step-02-apply-1.yaml | ||
- name: step-03 | ||
try: | ||
- apply: | ||
expect: | ||
- check: | ||
($error != null): true | ||
file: repo-bad-git.yaml | ||
- apply: | ||
expect: | ||
- check: | ||
($error != null): true | ||
file: repo-bad-bucket.yaml | ||
- apply: | ||
expect: | ||
- check: | ||
($error != null): true | ||
file: repo-bad-helm.yaml | ||
- apply: | ||
expect: | ||
- check: | ||
($error != null): true | ||
file: repo-bad-image.yaml | ||
- apply: | ||
file: repo-good-git.yaml | ||
- apply: | ||
file: repo-good-bucket.yaml | ||
- apply: | ||
file: repo-good-helm.yaml | ||
- apply: | ||
file: repo-good-image.yaml | ||
- name: step-99 | ||
try: | ||
- delete: | ||
ref: | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
name: verify-flux-sources |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
istio/add-sidecar-injection-namespace/.chainsaw-test/chainsaw-step-02-apply-1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
istio-injection: enabled | ||
name: istio-test-en-ns |
6 changes: 6 additions & 0 deletions
6
istio/add-sidecar-injection-namespace/.chainsaw-test/chainsaw-step-02-apply-2.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
istio-injection: disabled | ||
name: istio-test-dis-ns |
4 changes: 4 additions & 0 deletions
4
istio/add-sidecar-injection-namespace/.chainsaw-test/chainsaw-step-02-apply-3.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: istio-test-none-ns |
6 changes: 6 additions & 0 deletions
6
istio/add-sidecar-injection-namespace/.chainsaw-test/chainsaw-step-02-apply-4.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
foo: bar | ||
name: istio-test-alt-ns |
33 changes: 33 additions & 0 deletions
33
istio/add-sidecar-injection-namespace/.chainsaw-test/chainsaw-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
creationTimestamp: null | ||
name: add-sidecar-injection-namespace | ||
spec: | ||
steps: | ||
- name: step-01 | ||
try: | ||
- apply: | ||
file: ../add-sidecar-injection-namespace.yaml | ||
- assert: | ||
file: policy-ready.yaml | ||
- name: step-02 | ||
try: | ||
- apply: | ||
file: chainsaw-step-02-apply-1.yaml | ||
- apply: | ||
file: chainsaw-step-02-apply-2.yaml | ||
- apply: | ||
file: chainsaw-step-02-apply-3.yaml | ||
- apply: | ||
file: chainsaw-step-02-apply-4.yaml | ||
- name: step-03 | ||
try: | ||
- assert: | ||
file: patched-ns-alt.yaml | ||
- assert: | ||
file: patched-ns-disabled.yaml | ||
- assert: | ||
file: patched-ns-enabled.yaml | ||
- assert: | ||
file: patched-ns-none.yaml |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.