diff --git a/.chainsaw-local.yaml b/.chainsaw-local.yaml index 43891c2f184..4ada6c2d042 100755 --- a/.chainsaw-local.yaml +++ b/.chainsaw-local.yaml @@ -4,6 +4,7 @@ kind: Configuration metadata: name: configuration-local spec: + template: true timeouts: assert: 5m cleanup: 5m diff --git a/.chainsaw.yaml b/.chainsaw.yaml index c4fd8863124..95c2827265c 100755 --- a/.chainsaw.yaml +++ b/.chainsaw.yaml @@ -5,6 +5,7 @@ metadata: name: configuration spec: skipDelete: true + template: true timeouts: assert: 6m40s cleanup: 6m40s diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 000d129cd0b..f52d5bc5346 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -39,7 +39,7 @@ jobs: uses: ./.github/actions/deploy-prometheus-on-cluster - name: Install Chainsaw - uses: kyverno/action-install-chainsaw@07b6c986572f2abaf6647c85d37cbecfddc4a6ab # v0.1.3 + uses: kyverno/action-install-chainsaw@8307cf9038333ce168dd4339ae24f9ab16ab7a00 # v0.1.4 - name: Run Scheduling Gates Integration Tests if: inputs.scheduling-gates == 'gates_on' && inputs.allowed-namespaces == 'allowed_ns_off' diff --git a/test/chainsaw/integration/app-creation-request/chainsaw-test.yaml b/test/chainsaw/integration/app-creation-request/chainsaw-test.yaml index 3cc5f97c48c..0a59d895333 100755 --- a/test/chainsaw/integration/app-creation-request/chainsaw-test.yaml +++ b/test/chainsaw/integration/app-creation-request/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: app-creation-request spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/app-failing-post-evaluation/chainsaw-test.yaml b/test/chainsaw/integration/app-failing-post-evaluation/chainsaw-test.yaml index ef8b3209bed..737185094c8 100755 --- a/test/chainsaw/integration/app-failing-post-evaluation/chainsaw-test.yaml +++ b/test/chainsaw/integration/app-failing-post-evaluation/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: app-failing-post-evaluation spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/app-failing-post-task/chainsaw-test.yaml b/test/chainsaw/integration/app-failing-post-task/chainsaw-test.yaml index f092d834b25..cdf10109f3d 100755 --- a/test/chainsaw/integration/app-failing-post-task/chainsaw-test.yaml +++ b/test/chainsaw/integration/app-failing-post-task/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: app-failing-post-task spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/app-failing-pre-evaluation/chainsaw-test.yaml b/test/chainsaw/integration/app-failing-pre-evaluation/chainsaw-test.yaml index 819bf4e35d1..4b01502aae2 100755 --- a/test/chainsaw/integration/app-failing-pre-evaluation/chainsaw-test.yaml +++ b/test/chainsaw/integration/app-failing-pre-evaluation/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: app-failing-pre-evaluation spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/app-failing-pre-task-retry/chainsaw-test.yaml b/test/chainsaw/integration/app-failing-pre-task-retry/chainsaw-test.yaml index 67aea41ee76..9da5188a287 100755 --- a/test/chainsaw/integration/app-failing-pre-task-retry/chainsaw-test.yaml +++ b/test/chainsaw/integration/app-failing-pre-task-retry/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: app-failing-pre-task-retry spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/app-failing-pre-task-timeout/chainsaw-test.yaml b/test/chainsaw/integration/app-failing-pre-task-timeout/chainsaw-test.yaml index 22cd9f1c248..7ab63e8313e 100755 --- a/test/chainsaw/integration/app-failing-pre-task-timeout/chainsaw-test.yaml +++ b/test/chainsaw/integration/app-failing-pre-task-timeout/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: app-failing-pre-task-timeout spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/app-failing-pre-task/chainsaw-test.yaml b/test/chainsaw/integration/app-failing-pre-task/chainsaw-test.yaml index 86439a1aeb5..d149c93538d 100755 --- a/test/chainsaw/integration/app-failing-pre-task/chainsaw-test.yaml +++ b/test/chainsaw/integration/app-failing-pre-task/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: app-failing-pre-task spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/app-one-taskdefinition-not-found/chainsaw-test.yaml b/test/chainsaw/integration/app-one-taskdefinition-not-found/chainsaw-test.yaml index 517902b99ae..446960b490f 100755 --- a/test/chainsaw/integration/app-one-taskdefinition-not-found/chainsaw-test.yaml +++ b/test/chainsaw/integration/app-one-taskdefinition-not-found/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: app-one-taskdefinition-not-found spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/container-runtime/chainsaw-test.yaml b/test/chainsaw/integration/container-runtime/chainsaw-test.yaml index e4c1da36453..9392ac44a71 100755 --- a/test/chainsaw/integration/container-runtime/chainsaw-test.yaml +++ b/test/chainsaw/integration/container-runtime/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: container-runtime spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/imagepullsecret/chainsaw-test.yaml b/test/chainsaw/integration/imagepullsecret/chainsaw-test.yaml index b952cdb564e..2e2913b3bec 100755 --- a/test/chainsaw/integration/imagepullsecret/chainsaw-test.yaml +++ b/test/chainsaw/integration/imagepullsecret/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: imagepullsecret spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/podtato-head-application-auto-app-discovery/chainsaw-test.yaml b/test/chainsaw/integration/podtato-head-application-auto-app-discovery/chainsaw-test.yaml index 2fb5a45bfb0..529e3149e1d 100755 --- a/test/chainsaw/integration/podtato-head-application-auto-app-discovery/chainsaw-test.yaml +++ b/test/chainsaw/integration/podtato-head-application-auto-app-discovery/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: podtato-head-application-auto-app-discovery spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/podtato-head-application/chainsaw-test.yaml b/test/chainsaw/integration/podtato-head-application/chainsaw-test.yaml index 2b5635d52ed..2e5cb155957 100755 --- a/test/chainsaw/integration/podtato-head-application/chainsaw-test.yaml +++ b/test/chainsaw/integration/podtato-head-application/chainsaw-test.yaml @@ -5,11 +5,13 @@ metadata: creationTimestamp: null name: podtato-head-application spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/restartable-app/chainsaw-test.yaml b/test/chainsaw/integration/restartable-app/chainsaw-test.yaml index 5fdd95c7e5f..4c6cb791330 100755 --- a/test/chainsaw/integration/restartable-app/chainsaw-test.yaml +++ b/test/chainsaw/integration/restartable-app/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: restartable-app spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-daemonset-annotated/chainsaw-test.yaml b/test/chainsaw/integration/simple-daemonset-annotated/chainsaw-test.yaml index b418d675fa8..251469bc6e5 100755 --- a/test/chainsaw/integration/simple-daemonset-annotated/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-daemonset-annotated/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-daemonset-annotated spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: @@ -16,8 +18,6 @@ spec: catch: - podLogs: selector: app=daemonset - - script: - content: kubectl logs -l app=daemonset -n $NAMESPACE - name: step-01 try: - apply: diff --git a/test/chainsaw/integration/simple-deployment-annotated-with-app-context/chainsaw-test.yaml b/test/chainsaw/integration/simple-deployment-annotated-with-app-context/chainsaw-test.yaml index 8c7a35fde5c..453fe47b12d 100755 --- a/test/chainsaw/integration/simple-deployment-annotated-with-app-context/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-deployment-annotated-with-app-context/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-deployment-annotated-with-app-context spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-deployment-container-annotation/chainsaw-test.yaml b/test/chainsaw/integration/simple-deployment-container-annotation/chainsaw-test.yaml index 947d24e625e..bec6915a9a7 100755 --- a/test/chainsaw/integration/simple-deployment-container-annotation/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-deployment-container-annotation/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-deployment-container-annotation spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-deployment-evaluation/chainsaw-test.yaml b/test/chainsaw/integration/simple-deployment-evaluation/chainsaw-test.yaml index c9fc2d4cb71..adfbc4019b9 100755 --- a/test/chainsaw/integration/simple-deployment-evaluation/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-deployment-evaluation/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-deployment-evaluation spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-deployment-k8s-recommended-label/chainsaw-test.yaml b/test/chainsaw/integration/simple-deployment-k8s-recommended-label/chainsaw-test.yaml index ef98e7e9258..ce7ee578706 100755 --- a/test/chainsaw/integration/simple-deployment-k8s-recommended-label/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-deployment-k8s-recommended-label/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-deployment-k8s-recommended-label spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-deployment-python-runtime/chainsaw-test.yaml b/test/chainsaw/integration/simple-deployment-python-runtime/chainsaw-test.yaml index 0f1f35328cd..ca6d57e5553 100755 --- a/test/chainsaw/integration/simple-deployment-python-runtime/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-deployment-python-runtime/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-deployment-python-runtime spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-deployment-recursive-task/chainsaw-test.yaml b/test/chainsaw/integration/simple-deployment-recursive-task/chainsaw-test.yaml index 161d77ff6fb..c9b26eaf1c8 100755 --- a/test/chainsaw/integration/simple-deployment-recursive-task/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-deployment-recursive-task/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-deployment-recursive-task spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-deployment-sanitize-version-number/chainsaw-test.yaml b/test/chainsaw/integration/simple-deployment-sanitize-version-number/chainsaw-test.yaml index 43708929a3d..ea240a3633b 100755 --- a/test/chainsaw/integration/simple-deployment-sanitize-version-number/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-deployment-sanitize-version-number/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-deployment-sanitize-version-number spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-deployment/chainsaw-test.yaml b/test/chainsaw/integration/simple-deployment/chainsaw-test.yaml index 287877d618b..65b47a54766 100755 --- a/test/chainsaw/integration/simple-deployment/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-deployment/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-deployment spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/simple-statefulset-annotated/chainsaw-test.yaml b/test/chainsaw/integration/simple-statefulset-annotated/chainsaw-test.yaml index c0983500661..115b19e5560 100755 --- a/test/chainsaw/integration/simple-statefulset-annotated/chainsaw-test.yaml +++ b/test/chainsaw/integration/simple-statefulset-annotated/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: simple-statefulset-annotated spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/unsupported-owner-of-pod/chainsaw-test.yaml b/test/chainsaw/integration/unsupported-owner-of-pod/chainsaw-test.yaml index 3301626ce89..9bb3b85ff9d 100755 --- a/test/chainsaw/integration/unsupported-owner-of-pod/chainsaw-test.yaml +++ b/test/chainsaw/integration/unsupported-owner-of-pod/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: unsupported-owner-of-pod spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/workload-instance-failing-pre-task/chainsaw-test.yaml b/test/chainsaw/integration/workload-instance-failing-pre-task/chainsaw-test.yaml index f92ed1d0070..829eabc83a2 100755 --- a/test/chainsaw/integration/workload-instance-failing-pre-task/chainsaw-test.yaml +++ b/test/chainsaw/integration/workload-instance-failing-pre-task/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: workload-instance-failing-pre-task spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/integration/workload-instance-missing-evaluation/chainsaw-test.yaml b/test/chainsaw/integration/workload-instance-missing-evaluation/chainsaw-test.yaml index c783776412c..e4d04717cd3 100755 --- a/test/chainsaw/integration/workload-instance-missing-evaluation/chainsaw-test.yaml +++ b/test/chainsaw/integration/workload-instance-missing-evaluation/chainsaw-test.yaml @@ -4,11 +4,13 @@ kind: Test metadata: name: workload-instance-missing-evaluation spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: diff --git a/test/chainsaw/scheduling-gates/simple-deployment-restart-pod/chainsaw-test.yaml b/test/chainsaw/scheduling-gates/simple-deployment-restart-pod/chainsaw-test.yaml index 33eb63e3514..7e4ba3dcfe5 100755 --- a/test/chainsaw/scheduling-gates/simple-deployment-restart-pod/chainsaw-test.yaml +++ b/test/chainsaw/scheduling-gates/simple-deployment-restart-pod/chainsaw-test.yaml @@ -5,11 +5,13 @@ metadata: creationTimestamp: null name: simple-deployment-restart-pod spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: @@ -17,10 +19,10 @@ spec: catch: - podLogs: selector: app=test - - script: - content: kubectl describe keptnworkloadversion -n $NAMESPACE - - script: - content: kubectl describe keptnappversion -n $NAMESPACE + - describe: + resource: keptnworkloadversion + - describe: + resource: keptnappversion - podLogs: namespace: keptn-system selector: control-plane=lifecycle-operator @@ -31,10 +33,10 @@ spec: catch: - podLogs: selector: app=test - - script: - content: kubectl describe keptnworkloadversion -n $NAMESPACE - - script: - content: kubectl describe keptnappversion -n $NAMESPACE + - describe: + resource: keptnworkloadversion + - describe: + resource: keptnappversion - podLogs: namespace: keptn-system selector: control-plane=lifecycle-operator @@ -47,10 +49,10 @@ spec: catch: - podLogs: selector: app=test - - script: - content: kubectl describe keptnworkloadversion -n $NAMESPACE - - script: - content: kubectl describe keptnappversion -n $NAMESPACE + - describe: + resource: keptnworkloadversion + - describe: + resource: keptnappversion - podLogs: namespace: keptn-system selector: control-plane=lifecycle-operator diff --git a/test/chainsaw/scheduling-gates/simple-deployment/chainsaw-test.yaml b/test/chainsaw/scheduling-gates/simple-deployment/chainsaw-test.yaml index 8e112ef42ed..4ed72ae4134 100755 --- a/test/chainsaw/scheduling-gates/simple-deployment/chainsaw-test.yaml +++ b/test/chainsaw/scheduling-gates/simple-deployment/chainsaw-test.yaml @@ -5,11 +5,13 @@ metadata: creationTimestamp: null name: simple-deployment spec: + namespaceTemplate: + metadata: + annotations: + keptn.sh/lifecycle-toolkit: enabled steps: - name: step-00 try: - - script: - content: kubectl annotate ns $NAMESPACE keptn.sh/lifecycle-toolkit='enabled' - apply: file: 00-install.yaml - assert: @@ -17,12 +19,13 @@ spec: catch: - podLogs: selector: app=test - - script: - content: kubectl describe keptnworkloadversion -n $NAMESPACE - - script: - content: kubectl describe keptnappversion -n $NAMESPACE - - script: - content: kubectl logs -l control-plane=lifecycle-operator -n keptn-system + - describe: + resource: keptnworkloadversion + - describe: + resource: keptnappversion + - podLogs: + selector: control-plane=lifecycle-operator + namespace: keptn-system - name: step-01 try: - assert: @@ -30,9 +33,10 @@ spec: catch: - podLogs: selector: app=test - - script: - content: kubectl describe keptnworkloadversion -n $NAMESPACE - - script: - content: kubectl describe keptnappversion -n $NAMESPACE - - script: - content: kubectl logs -l control-plane=lifecycle-operator -n keptn-system + - describe: + resource: keptnworkloadversion + - describe: + resource: keptnappversion + - podLogs: + selector: control-plane=lifecycle-operator + namespace: keptn-system diff --git a/test/chainsaw/testanalysis/analysis-controller-existing-status/chainsaw-test.yaml b/test/chainsaw/testanalysis/analysis-controller-existing-status/chainsaw-test.yaml index c85177eb9ff..37b1f92e6fb 100755 --- a/test/chainsaw/testanalysis/analysis-controller-existing-status/chainsaw-test.yaml +++ b/test/chainsaw/testanalysis/analysis-controller-existing-status/chainsaw-test.yaml @@ -7,32 +7,33 @@ spec: steps: - name: step-00 try: - - script: - content: | - envsubst < install.yaml | kubectl apply -f - -n $NAMESPACE + - apply: + file: install.yaml catch: - - script: - content: kubectl logs -l control-plane=metrics-operator -n keptn-system - - script: - content: kubectl describe Analysis -n $NAMESPACE + - podLogs: + namespace: keptn-system + selector: control-plane=metrics-operator + - describe: + resource: Analysis - name: step-01 try: - assert: file: assert-1.yaml - - script: - content: | - envsubst < mock-server.yaml | kubectl apply -f - -n $NAMESPACE + - apply: + file: mock-server.yaml catch: - - script: - content: kubectl logs -l control-plane=metrics-operator -n keptn-system - - script: - content: kubectl describe Analysis -n $NAMESPACE + - podLogs: + namespace: keptn-system + selector: control-plane=metrics-operator + - describe: + resource: Analysis - name: step-02 try: - assert: file: assert-2.yaml catch: - - script: - content: kubectl logs -l control-plane=metrics-operator -n keptn-system - - script: - content: kubectl describe Analysis -n $NAMESPACE + - podLogs: + namespace: keptn-system + selector: control-plane=metrics-operator + - describe: + resource: Analysis diff --git a/test/chainsaw/testanalysis/analysis-controller-existing-status/install.yaml b/test/chainsaw/testanalysis/analysis-controller-existing-status/install.yaml index a946dbfb503..3b0a438a8a9 100644 --- a/test/chainsaw/testanalysis/analysis-controller-existing-status/install.yaml +++ b/test/chainsaw/testanalysis/analysis-controller-existing-status/install.yaml @@ -55,4 +55,4 @@ metadata: name: my-mocked-provider spec: type: prometheus - targetServer: "http://mockserver.$NAMESPACE.svc.cluster.local:1080" + targetServer: (join('.', ['http://mockserver', $namespace, 'svc.cluster.local:1080'])) diff --git a/test/chainsaw/testanalysis/analysis-controller-multiple-providers/chainsaw-test.yaml b/test/chainsaw/testanalysis/analysis-controller-multiple-providers/chainsaw-test.yaml index 54545a86d09..7f9860648bb 100755 --- a/test/chainsaw/testanalysis/analysis-controller-multiple-providers/chainsaw-test.yaml +++ b/test/chainsaw/testanalysis/analysis-controller-multiple-providers/chainsaw-test.yaml @@ -7,18 +7,17 @@ spec: steps: - name: step-00 try: - - script: - content: | - envsubst < mock-server.yaml | kubectl apply -f - - - script: - content: | - envsubst < install.yaml | kubectl apply -f - -n $NAMESPACE + - apply: + file: mock-server.yaml + - apply: + file: install.yaml - name: step-01 try: - assert: file: assert-1.yaml catch: - - script: - content: kubectl logs -l control-plane=metrics-operator -n keptn-system - - script: - content: kubectl describe Analysis -n $NAMESPACE + - podLogs: + namespace: keptn-system + selector: control-plane=metrics-operator + - describe: + resource: Analysis diff --git a/test/chainsaw/testanalysis/analysis-controller-multiple-providers/install.yaml b/test/chainsaw/testanalysis/analysis-controller-multiple-providers/install.yaml index 073f5492876..d8b206a1047 100644 --- a/test/chainsaw/testanalysis/analysis-controller-multiple-providers/install.yaml +++ b/test/chainsaw/testanalysis/analysis-controller-multiple-providers/install.yaml @@ -85,7 +85,7 @@ metadata: name: my-first-mocked-provider spec: type: prometheus - targetServer: "http://mockserver.$NAMESPACE.svc.cluster.local:1080" + targetServer: (join('.', ['http://mockserver', $namespace, 'svc.cluster.local:1080'])) --- apiVersion: metrics.keptn.sh/v1beta1 kind: KeptnMetricsProvider @@ -93,7 +93,7 @@ metadata: name: my-second-mocked-provider spec: type: prometheus - targetServer: "http://mockserver.$NAMESPACE.svc.cluster.local:1080" + targetServer: (join('.', ['http://mockserver', $namespace, 'svc.cluster.local:1080'])) --- apiVersion: metrics.keptn.sh/v1beta1 kind: KeptnMetricsProvider @@ -101,4 +101,4 @@ metadata: name: my-third-mocked-provider spec: type: prometheus - targetServer: "http://mockserver.$NAMESPACE.svc.cluster.local:1080" + targetServer: (join('.', ['http://mockserver', $namespace, 'svc.cluster.local:1080'])) diff --git a/test/chainsaw/testanalysis/analysis-controller-multiple-providers/mock-server.yaml b/test/chainsaw/testanalysis/analysis-controller-multiple-providers/mock-server.yaml index 783d9c5eb69..fc82c9baef1 100644 --- a/test/chainsaw/testanalysis/analysis-controller-multiple-providers/mock-server.yaml +++ b/test/chainsaw/testanalysis/analysis-controller-multiple-providers/mock-server.yaml @@ -2,7 +2,6 @@ apiVersion: v1 kind: Service metadata: name: mockserver - namespace: $NAMESPACE spec: ports: - name: serviceport @@ -20,7 +19,6 @@ metadata: labels: app: mockserver name: mockserver - namespace: $NAMESPACE spec: replicas: 1 selector: @@ -91,7 +89,6 @@ kind: ConfigMap apiVersion: v1 metadata: name: mockserver-config - namespace: $NAMESPACE data: initializerJson.json: |- [ diff --git a/test/chainsaw/testanalysis/analysis-controller-with-duration-timeframe/chainsaw-test.yaml b/test/chainsaw/testanalysis/analysis-controller-with-duration-timeframe/chainsaw-test.yaml index aad617dcf02..0670e631936 100755 --- a/test/chainsaw/testanalysis/analysis-controller-with-duration-timeframe/chainsaw-test.yaml +++ b/test/chainsaw/testanalysis/analysis-controller-with-duration-timeframe/chainsaw-test.yaml @@ -7,18 +7,17 @@ spec: steps: - name: step-00 try: - - script: - content: | - kubectl apply -f mock-server.yaml -n $NAMESPACE - - script: - content: | - envsubst < install.yaml | kubectl apply -f - -n $NAMESPACE + - apply: + file: mock-server.yaml + - apply: + file: install.yaml - name: step-01 try: - assert: file: assert-1.yaml catch: - - script: - content: kubectl logs -l control-plane=metrics-operator -n keptn-system - - script: - content: kubectl describe Analysis -n $NAMESPACE + - podLogs: + namespace: keptn-system + selector: control-plane=metrics-operator + - describe: + resource: Analysis diff --git a/test/chainsaw/testanalysis/analysis-controller-with-duration-timeframe/install.yaml b/test/chainsaw/testanalysis/analysis-controller-with-duration-timeframe/install.yaml index 6d82e7abac5..4c96d256f4f 100644 --- a/test/chainsaw/testanalysis/analysis-controller-with-duration-timeframe/install.yaml +++ b/test/chainsaw/testanalysis/analysis-controller-with-duration-timeframe/install.yaml @@ -46,4 +46,4 @@ metadata: name: my-mocked-provider spec: type: prometheus - targetServer: "http://mockserver.$NAMESPACE.svc.cluster.local:1080" + targetServer: (join('.', ['http://mockserver', $namespace, 'svc.cluster.local:1080'])) diff --git a/test/chainsaw/testanalysis/analysis-controller/chainsaw-test.yaml b/test/chainsaw/testanalysis/analysis-controller/chainsaw-test.yaml index 7b2b6277f18..7bcce550c6d 100755 --- a/test/chainsaw/testanalysis/analysis-controller/chainsaw-test.yaml +++ b/test/chainsaw/testanalysis/analysis-controller/chainsaw-test.yaml @@ -7,18 +7,17 @@ spec: steps: - name: step-00 try: - - script: - content: | - kubectl apply -f mock-server.yaml -n $NAMESPACE - - script: - content: | - envsubst < install.yaml | kubectl apply -f - -n $NAMESPACE + - apply: + file: mock-server.yaml + - apply: + file: install.yaml - name: step-01 try: - assert: file: assert-1.yaml catch: - - script: - content: kubectl logs -l control-plane=metrics-operator -n keptn-system - - script: - content: kubectl describe Analysis -n $NAMESPACE + - podLogs: + namespace: keptn-system + selector: control-plane=metrics-operator + - describe: + resource: Analysis diff --git a/test/chainsaw/testanalysis/analysis-controller/install.yaml b/test/chainsaw/testanalysis/analysis-controller/install.yaml index 6d82e7abac5..4c96d256f4f 100644 --- a/test/chainsaw/testanalysis/analysis-controller/install.yaml +++ b/test/chainsaw/testanalysis/analysis-controller/install.yaml @@ -46,4 +46,4 @@ metadata: name: my-mocked-provider spec: type: prometheus - targetServer: "http://mockserver.$NAMESPACE.svc.cluster.local:1080" + targetServer: (join('.', ['http://mockserver', $namespace, 'svc.cluster.local:1080'])) diff --git a/test/chainsaw/testmetrics/metrics-hpa/chainsaw-test.yaml b/test/chainsaw/testmetrics/metrics-hpa/chainsaw-test.yaml index 94582b62aa1..a9f91182b98 100755 --- a/test/chainsaw/testmetrics/metrics-hpa/chainsaw-test.yaml +++ b/test/chainsaw/testmetrics/metrics-hpa/chainsaw-test.yaml @@ -10,23 +10,26 @@ spec: try: - apply: file: 00-install.yaml - - script: - content: | - kubectl apply -f mock-server.yaml -n $NAMESPACE - - script: - content: | - echo "registering the metric" - envsubst < metric.yaml | kubectl apply -f - -n $NAMESPACE - echo "configuring HPA" - kubectl apply -f hpa.yaml -n $NAMESPACE + - apply: + file: mock-server.yaml + - apply: + file: metric.yaml + - apply: + file: hpa.yaml - assert: file: deployment.yaml catch: - podLogs: selector: app=podtato-head - - script: - content: | - kubectl logs -l app=metrics-operator -n keptn-system - kubectl describe keptnmetric podtatometric -n $NAMESPACE - kubectl describe keptnmetricsprovider dynatrace -n $NAMESPACE - kubectl describe pods -l app=podtato-head -n $NAMESPACE + - podLogs: + namespace: keptn-system + selector: app=metrics-operator + - describe: + resource: keptnmetric + name: podtatometric + - describe: + resource: keptnmetricsprovider + name: dynatrace + - describe: + resource: pods + selector: app=podtato-head diff --git a/test/chainsaw/testmetrics/metrics-hpa/metric.yaml b/test/chainsaw/testmetrics/metrics-hpa/metric.yaml index 6c72b1c91cd..bdb879653d0 100644 --- a/test/chainsaw/testmetrics/metrics-hpa/metric.yaml +++ b/test/chainsaw/testmetrics/metrics-hpa/metric.yaml @@ -4,7 +4,7 @@ metadata: name: my-provider spec: type: prometheus - targetServer: "http://mockserver.$NAMESPACE.svc.cluster.local:1080" + targetServer: (join('.', ['http://mockserver', $namespace, 'svc.cluster.local:1080'])) --- apiVersion: metrics.keptn.sh/v1beta1 kind: KeptnMetric