Skip to content

Commit eb39805

Browse files
committed
chore: migrate from kuttl to chainsaw
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
1 parent b32c855 commit eb39805

File tree

121 files changed

+2291
-1153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2291
-1153
lines changed

.chainsaw.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/configuration-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Configuration
4+
metadata:
5+
name: configuration
6+
spec:
7+
parallel: 4
8+
timeouts:
9+
assert: 5m0s
10+
cleanup: 5m0s
11+
delete: 5m0s
12+
error: 5m0s

.github/workflows/e2e.yaml

+16-12
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ concurrency:
1212

1313
jobs:
1414
e2e-tests:
15-
name: End-to-end tests ${{ matrix.group }} on K8s ${{ matrix.kube-version }}
1615
runs-on: ubuntu-22.04
1716
strategy:
1817
fail-fast: false
@@ -25,13 +24,13 @@ jobs:
2524
- "1.29"
2625
group:
2726
- e2e
28-
- e2e-instrumentation
29-
- e2e-upgrade
3027
- e2e-autoscale
31-
- e2e-pdb
28+
- e2e-instrumentation
3229
- e2e-opampbridge
33-
- e2e-targetallocator
30+
- e2e-pdb
3431
- e2e-prometheuscr
32+
- e2e-targetallocator
33+
- e2e-upgrade
3534
- e2e-multi-instrumentation
3635
include:
3736
- group: e2e-prometheuscr
@@ -42,33 +41,38 @@ jobs:
4241
steps:
4342
- name: Check out code into the Go module directory
4443
uses: actions/checkout@v4
45-
4644
- name: Set up Go
4745
uses: actions/setup-go@v5
4846
with:
4947
go-version: "~1.21.3"
50-
5148
- name: Cache tools
5249
uses: actions/cache@v4
5350
with:
5451
path: bin
5552
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}
56-
53+
- name: Install chainsaw
54+
uses: kyverno/[email protected]
5755
- name: Install tools
5856
run: make install-tools
59-
60-
- name: "run tests"
57+
- name: Prepare e2e tests
6158
env:
6259
KUBE_VERSION: ${{ matrix.kube-version }}
6360
run: |
61+
set -e
6462
make ${{ matrix.setup != '' && matrix.setup || 'prepare-e2e' }} KUBE_VERSION=$KUBE_VERSION VERSION=e2e
63+
- name: Run e2e tests
64+
env:
65+
KUBE_VERSION: ${{ matrix.kube-version }}
66+
run: |
67+
set -e
6568
make ${{ matrix.group }}
66-
6769
- name: "log operator if failed"
6870
if: ${{ failure() }}
6971
env:
7072
KUBE_VERSION: ${{ matrix.kube-version }}
71-
run: make e2e-log-operator KUBE_VERSION=$KUBE_VERSION
73+
run: |
74+
set -e
75+
make e2e-log-operator KUBE_VERSION=$KUBE_VERSION
7276
7377
e2e-tests-check:
7478
runs-on: ubuntu-22.04

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ KUBEBUILDER_ASSETS=$(./bin/setup-envtest use -p path 1.23) go test ./pkg...
118118

119119
### End to end tests
120120

121-
To run the end-to-end tests, you'll need [`kind`](https://kind.sigs.k8s.io) and [`kuttl`](https://kuttl.dev). Refer to their documentation for installation instructions.
121+
To run the end-to-end tests, you'll need [`kind`](https://kind.sigs.k8s.io) and [`chainsaw`](https://kyverno.github.io/chainsaw). Refer to their documentation for installation instructions.
122122

123123
Once they are installed, the tests can be executed with `make prepare-e2e`, which will build an image to use with the tests, followed by `make e2e`. Each call to the `e2e` target will setup a fresh `kind` cluster, making it safe to be executed multiple times with a single `prepare-e2e` step.
124124

125-
The tests are located under `tests/e2e` and are written to be used with `kuttl`. Refer to their documentation to understand how tests are written.
125+
The tests are located under `tests/e2e` and are written to be used with `chainsaw`. Refer to their documentation to understand how tests are written.
126126

127127
To evert the changes made by the `make prepare-e2e` run `make reset`.
128128

@@ -133,7 +133,7 @@ To install the OpenTelemetry operator, please follow the instructions in [Opera
133133

134134
Once the operator is installed, the tests can be executed using `make e2e-openshift`, which will call to the `e2e-openshift` target. Note that `kind` is disabled for the TestSuite as the requirement is to use an OpenShift cluster for these test cases.
135135

136-
The tests are located under `tests/e2e-openshift` and are written to be used with `kuttl`.
136+
The tests are located under `tests/e2e-openshift` and are written to be used with `chainsaw`.
137137

138138
### Undeploying the operator from the local cluster
139139

hack/install-kuttl.sh

-12
This file was deleted.

kuttl-test-autoscale.yaml

-6
This file was deleted.

kuttl-test-instrumentation.yaml

-5
This file was deleted.

kuttl-test-multi-instr.yaml

-6
This file was deleted.

kuttl-test-opampbridge.yaml

-6
This file was deleted.

kuttl-test-openshift.yaml

-6
This file was deleted.

kuttl-test-pdb.yaml

-6
This file was deleted.

kuttl-test-prometheuscr.yaml

-16
This file was deleted.

kuttl-test-targetallocator.yaml

-6
This file was deleted.

kuttl-test-upgrade.yaml

-19
This file was deleted.

kuttl-test.yaml

-7
This file was deleted.

tests/e2e-autoscale/autoscale/03-delete.yaml

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: autoscale
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- apply:
12+
file: 00-install.yaml
13+
- assert:
14+
file: 00-assert.yaml
15+
- name: step-01
16+
try:
17+
- apply:
18+
file: 01-install.yaml
19+
- assert:
20+
file: 01-assert.yaml
21+
- name: step-02
22+
try:
23+
- apply:
24+
file: 02-install.yaml
25+
- assert:
26+
file: 02-assert.yaml
27+
- name: step-03
28+
try:
29+
- delete:
30+
ref:
31+
apiVersion: batch/v1
32+
kind: Job
33+
name: telemetrygen-set-utilization
34+
- assert:
35+
file: 03-assert.yaml

tests/e2e-instrumentation/instrumentation-apache-httpd/00-install-collector.yaml

+1-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ kind: OpenTelemetryCollector
33
metadata:
44
name: sidecar
55
spec:
6-
mode: sidecar
76
config: |
87
receivers:
98
otlp:
@@ -19,13 +18,4 @@ spec:
1918
receivers: [otlp]
2019
processors: []
2120
exporters: [debug]
22-
23-
---
24-
apiVersion: kuttl.dev/v1beta1
25-
kind: TestStep
26-
commands:
27-
# Annotate the namespace to allow the application to run using an specific group and user in OpenShift
28-
# https://docs.openshift.com/dedicated/authentication/managing-security-context-constraints.html
29-
# This annotation has no effect in Kubernetes
30-
- command: kubectl annotate namespace ${NAMESPACE} openshift.io/sa.scc.uid-range=1000/1000 --overwrite
31-
- command: kubectl annotate namespace ${NAMESPACE} openshift.io/sa.scc.supplemental-groups=3000/1000 --overwrite
21+
mode: sidecar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: instrumentation-apache-httpd
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- command:
12+
args:
13+
- annotate
14+
- namespace
15+
- ${NAMESPACE}
16+
- openshift.io/sa.scc.uid-range=1000/1000
17+
- --overwrite
18+
entrypoint: kubectl
19+
- command:
20+
args:
21+
- annotate
22+
- namespace
23+
- ${NAMESPACE}
24+
- openshift.io/sa.scc.supplemental-groups=3000/1000
25+
- --overwrite
26+
entrypoint: kubectl
27+
- apply:
28+
file: 00-install-collector.yaml
29+
- apply:
30+
file: 00-install-instrumentation.yaml
31+
- name: step-01
32+
try:
33+
- apply:
34+
file: 01-install-app.yaml
35+
- assert:
36+
file: 01-assert.yaml
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# skipping test, see https://github.com/open-telemetry/opentelemetry-operator/issues/1936
2-
#apiVersion: opentelemetry.io/v1alpha1
3-
#kind: OpenTelemetryCollector
4-
#metadata:
5-
# name: sidecar
6-
#spec:
7-
# mode: sidecar
8-
# config: |
9-
# receivers:
10-
# otlp:
11-
# protocols:
12-
# grpc:
13-
# http:
14-
# processors:
15-
# exporters:
16-
# debug:
17-
# service:
18-
# pipelines:
19-
# traces:
20-
# receivers: [otlp]
21-
# processors: []
22-
# exporters: [debug]
2+
apiVersion: opentelemetry.io/v1alpha1
3+
kind: OpenTelemetryCollector
4+
metadata:
5+
name: sidecar
6+
spec:
7+
mode: sidecar
8+
config: |
9+
receivers:
10+
otlp:
11+
protocols:
12+
grpc:
13+
http:
14+
processors:
15+
exporters:
16+
debug:
17+
service:
18+
pipelines:
19+
traces:
20+
receivers: [otlp]
21+
processors: []
22+
exporters: [debug]
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# skipping test, see https://github.com/open-telemetry/opentelemetry-operator/issues/1936
2-
#apiVersion: opentelemetry.io/v1alpha1
3-
#kind: Instrumentation
4-
#metadata:
5-
# name: apache
6-
#spec:
7-
# exporter:
8-
# endpoint: http://localhost:4317
9-
# propagators:
10-
# - jaeger
11-
# - b3
12-
# sampler:
13-
# type: parentbased_traceidratio
14-
# argument: "0.25"
15-
# apacheHttpd:
16-
# attrs:
17-
# - name: ApacheModuleOtelMaxQueueSize
18-
# value: "4096"
2+
apiVersion: opentelemetry.io/v1alpha1
3+
kind: Instrumentation
4+
metadata:
5+
name: apache
6+
spec:
7+
exporter:
8+
endpoint: http://localhost:4317
9+
propagators:
10+
- jaeger
11+
- b3
12+
sampler:
13+
type: parentbased_traceidratio
14+
argument: "0.25"
15+
apacheHttpd:
16+
attrs:
17+
- name: ApacheModuleOtelMaxQueueSize
18+
value: "4096"

0 commit comments

Comments
 (0)