diff --git a/sidecar/Dockerfile b/sidecar/Dockerfile index b638e0c1..edb84801 100644 --- a/sidecar/Dockerfile +++ b/sidecar/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20.7 as go-builder +FROM golang:1.21.3 as go-builder RUN mkdir /build ADD ./out_gstdout /build/ WORKDIR /build diff --git a/tests/modified/operator/daemonset-with-annotations/00-assert.yaml b/tests/modified/operator/daemonset-with-annotations/00-assert.yaml index 4a8baa77..faa3f1fb 100644 --- a/tests/modified/operator/daemonset-with-annotations/00-assert.yaml +++ b/tests/modified/operator/daemonset-with-annotations/00-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=daemonset-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs -l app=daemonset-with-annotations -c tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" - script: "[ $(kubectl logs -l app=daemonset-with-annotations -c tailing-sidecar-1 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" diff --git a/tests/modified/operator/deployment-with-annotations/00-assert.yaml b/tests/modified/operator/deployment-with-annotations/00-assert.yaml index f9f072d7..a08e1361 100644 --- a/tests/modified/operator/deployment-with-annotations/00-assert.yaml +++ b/tests/modified/operator/deployment-with-annotations/00-assert.yaml @@ -10,6 +10,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=deployment-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs -l app=deployment-with-annotations -c tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" - script: "[ $(kubectl logs -l app=deployment-with-annotations -c tailing-sidecar-1 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" diff --git a/tests/modified/operator/deployment-with-annotations/01-assert.yaml b/tests/modified/operator/deployment-with-annotations/01-assert.yaml index 6169af4f..34044412 100644 --- a/tests/modified/operator/deployment-with-annotations/01-assert.yaml +++ b/tests/modified/operator/deployment-with-annotations/01-assert.yaml @@ -18,5 +18,7 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=deployment-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs -l app=deployment-with-annotations -c tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" diff --git a/tests/modified/operator/pod-with-annotations/00-assert.yaml b/tests/modified/operator/pod-with-annotations/00-assert.yaml index f3fdf96e..71627f17 100644 --- a/tests/modified/operator/pod-with-annotations/00-assert.yaml +++ b/tests/modified/operator/pod-with-annotations/00-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs pod-with-annotations tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" - script: "[ $(kubectl logs pod-with-annotations named-container -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" diff --git a/tests/modified/operator/pod-with-annotations/01-assert.yaml b/tests/modified/operator/pod-with-annotations/01-assert.yaml index 93390119..73870dc6 100644 --- a/tests/modified/operator/pod-with-annotations/01-assert.yaml +++ b/tests/modified/operator/pod-with-annotations/01-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-annotations-updated +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs pod-with-annotations-updated tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" - script: "[ $(kubectl logs pod-with-annotations-updated named-sidecar -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" diff --git a/tests/modified/operator/pod-with-cr/00-assert.yaml b/tests/modified/operator/pod-with-cr/00-assert.yaml index 0dc0fe14..53fb0b2d 100644 --- a/tests/modified/operator/pod-with-cr/00-assert.yaml +++ b/tests/modified/operator/pod-with-cr/00-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-tailing-sidecar-config +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs pod-with-tailing-sidecar-config sidecar-0 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" - script: "[ $(kubectl logs pod-with-tailing-sidecar-config sidecar-1 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" diff --git a/tests/modified/operator/pod-with-cr/01-assert.yaml b/tests/modified/operator/pod-with-cr/01-assert.yaml index 3e6970ec..7d589db0 100644 --- a/tests/modified/operator/pod-with-cr/01-assert.yaml +++ b/tests/modified/operator/pod-with-cr/01-assert.yaml @@ -12,5 +12,7 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-tailing-sidecar-config +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs pod-with-tailing-sidecar-config sidecar-2 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" diff --git a/tests/modified/operator/statefulset-with-annotations/00-assert.yaml b/tests/modified/operator/statefulset-with-annotations/00-assert.yaml index 5478a408..374ad13d 100644 --- a/tests/modified/operator/statefulset-with-annotations/00-assert.yaml +++ b/tests/modified/operator/statefulset-with-annotations/00-assert.yaml @@ -10,6 +10,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: statefulset-with-annotations-0 +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs statefulset-with-annotations-0 my-named-sidecar -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" - script: "[ $(kubectl logs statefulset-with-annotations-0 tailing-sidecar-1 -n ${NAMESPACE} --tail 5 | grep modified | wc -l) -eq 5 ]" diff --git a/tests/operator/daemonset-with-annotations/00-assert.yaml b/tests/operator/daemonset-with-annotations/00-assert.yaml index 3758548d..9e736173 100644 --- a/tests/operator/daemonset-with-annotations/00-assert.yaml +++ b/tests/operator/daemonset-with-annotations/00-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=daemonset-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs -l app=daemonset-with-annotations -c tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" - script: "[ $(kubectl logs -l app=daemonset-with-annotations -c tailing-sidecar-1 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" diff --git a/tests/operator/deployment-with-annotations/00-assert.yaml b/tests/operator/deployment-with-annotations/00-assert.yaml index b333e566..bc2c21dc 100644 --- a/tests/operator/deployment-with-annotations/00-assert.yaml +++ b/tests/operator/deployment-with-annotations/00-assert.yaml @@ -10,6 +10,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=deployment-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs -l app=deployment-with-annotations -c tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" - script: "[ $(kubectl logs -l app=deployment-with-annotations -c tailing-sidecar-1 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" diff --git a/tests/operator/deployment-with-annotations/01-assert.yaml b/tests/operator/deployment-with-annotations/01-assert.yaml index 6ededf9b..3d8d4863 100644 --- a/tests/operator/deployment-with-annotations/01-assert.yaml +++ b/tests/operator/deployment-with-annotations/01-assert.yaml @@ -18,5 +18,7 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=deployment-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs -l app=deployment-with-annotations -c tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" diff --git a/tests/operator/pod-with-annotations/00-assert.yaml b/tests/operator/pod-with-annotations/00-assert.yaml index 27a7fb43..3ff6ff0b 100644 --- a/tests/operator/pod-with-annotations/00-assert.yaml +++ b/tests/operator/pod-with-annotations/00-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs pod-with-annotations tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" - script: "[ $(kubectl logs pod-with-annotations named-container -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" diff --git a/tests/operator/pod-with-annotations/01-assert.yaml b/tests/operator/pod-with-annotations/01-assert.yaml index 97edee12..47c99589 100644 --- a/tests/operator/pod-with-annotations/01-assert.yaml +++ b/tests/operator/pod-with-annotations/01-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-annotations-updated +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs pod-with-annotations-updated tailing-sidecar-0 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" - script: "[ $(kubectl logs pod-with-annotations-updated named-sidecar -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" diff --git a/tests/operator/pod-with-cr/00-assert.yaml b/tests/operator/pod-with-cr/00-assert.yaml index a717d3e7..0f59e06e 100644 --- a/tests/operator/pod-with-cr/00-assert.yaml +++ b/tests/operator/pod-with-cr/00-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-tailing-sidecar-config +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs pod-with-tailing-sidecar-config sidecar-0 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" - script: "[ $(kubectl logs pod-with-tailing-sidecar-config sidecar-1 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" diff --git a/tests/operator/pod-with-cr/01-assert.yaml b/tests/operator/pod-with-cr/01-assert.yaml index eb71ec74..ed98267f 100644 --- a/tests/operator/pod-with-cr/01-assert.yaml +++ b/tests/operator/pod-with-cr/01-assert.yaml @@ -12,5 +12,7 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-tailing-sidecar-config +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs pod-with-tailing-sidecar-config sidecar-2 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" diff --git a/tests/operator/statefulset-with-annotations/00-assert.yaml b/tests/operator/statefulset-with-annotations/00-assert.yaml index c3d7ae0f..e3d68b82 100644 --- a/tests/operator/statefulset-with-annotations/00-assert.yaml +++ b/tests/operator/statefulset-with-annotations/00-assert.yaml @@ -10,6 +10,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: statefulset-with-annotations-0 +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs statefulset-with-annotations-0 my-named-sidecar -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" - script: "[ $(kubectl logs statefulset-with-annotations-0 tailing-sidecar-1 -n ${NAMESPACE} --tail 5 | grep example | wc -l) -eq 5 ]" diff --git a/tests/sidecar/pod-with-sidecar/00-assert.yaml b/tests/sidecar/pod-with-sidecar/00-assert.yaml index 81283a5a..c5708d0c 100644 --- a/tests/sidecar/pod-with-sidecar/00-assert.yaml +++ b/tests/sidecar/pod-with-sidecar/00-assert.yaml @@ -9,6 +9,8 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: example-with-tailling-sidecars +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system commands: - script: "[ $(kubectl logs -n $NAMESPACE --tail 5 example-with-tailling-sidecars sidecar1 | grep example1 | wc -l) -eq 5 ]" - script: "[ $(kubectl logs -n $NAMESPACE --tail 5 example-with-tailling-sidecars sidecar2 | grep example2 | wc -l) -eq 5 ]"