diff --git a/.gitignore b/.gitignore index dd7a887b..78d6f863 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ tests/_build .kubeconfig kubeconfig + +# Go workspace files +go.work +go.work.sum \ No newline at end of file diff --git a/tests/modified/operator/daemonset-with-annotations/00-assert.yaml b/tests/modified/operator/daemonset-with-annotations/00-assert.yaml index 4a8baa77..b318867c 100644 --- a/tests/modified/operator/daemonset-with-annotations/00-assert.yaml +++ b/tests/modified/operator/daemonset-with-annotations/00-assert.yaml @@ -9,6 +9,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=daemonset-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..5d8ba43d 100644 --- a/tests/modified/operator/deployment-with-annotations/00-assert.yaml +++ b/tests/modified/operator/deployment-with-annotations/00-assert.yaml @@ -10,6 +10,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=deployment-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..a5365a30 100644 --- a/tests/modified/operator/deployment-with-annotations/01-assert.yaml +++ b/tests/modified/operator/deployment-with-annotations/01-assert.yaml @@ -18,5 +18,11 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=deployment-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..eb7ca27f 100644 --- a/tests/modified/operator/pod-with-annotations/00-assert.yaml +++ b/tests/modified/operator/pod-with-annotations/00-assert.yaml @@ -9,6 +9,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..0c07247c 100644 --- a/tests/modified/operator/pod-with-annotations/01-assert.yaml +++ b/tests/modified/operator/pod-with-annotations/01-assert.yaml @@ -9,6 +9,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-annotations-updated +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..0cf561fd 100644 --- a/tests/modified/operator/pod-with-cr/00-assert.yaml +++ b/tests/modified/operator/pod-with-cr/00-assert.yaml @@ -9,6 +9,12 @@ 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 + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..03ca34ce 100644 --- a/tests/modified/operator/pod-with-cr/01-assert.yaml +++ b/tests/modified/operator/pod-with-cr/01-assert.yaml @@ -12,5 +12,11 @@ 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 + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..5a351965 100644 --- a/tests/modified/operator/statefulset-with-annotations/00-assert.yaml +++ b/tests/modified/operator/statefulset-with-annotations/00-assert.yaml @@ -10,6 +10,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: statefulset-with-annotations-0 +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..d71b2203 100644 --- a/tests/operator/daemonset-with-annotations/00-assert.yaml +++ b/tests/operator/daemonset-with-annotations/00-assert.yaml @@ -9,6 +9,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=daemonset-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..c71b4c41 100644 --- a/tests/operator/deployment-with-annotations/00-assert.yaml +++ b/tests/operator/deployment-with-annotations/00-assert.yaml @@ -10,6 +10,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=deployment-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..e1d64e7d 100644 --- a/tests/operator/deployment-with-annotations/01-assert.yaml +++ b/tests/operator/deployment-with-annotations/01-assert.yaml @@ -18,5 +18,11 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - selector: app=deployment-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..d246554d 100644 --- a/tests/operator/pod-with-annotations/00-assert.yaml +++ b/tests/operator/pod-with-annotations/00-assert.yaml @@ -9,6 +9,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-annotations +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..e63ac1db 100644 --- a/tests/operator/pod-with-annotations/01-assert.yaml +++ b/tests/operator/pod-with-annotations/01-assert.yaml @@ -9,6 +9,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: pod-with-annotations-updated +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..e98a8010 100644 --- a/tests/operator/pod-with-cr/00-assert.yaml +++ b/tests/operator/pod-with-cr/00-assert.yaml @@ -9,6 +9,12 @@ 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 + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..13bd8b9c 100644 --- a/tests/operator/pod-with-cr/01-assert.yaml +++ b/tests/operator/pod-with-cr/01-assert.yaml @@ -12,5 +12,11 @@ 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 + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..dcd888c7 100644 --- a/tests/operator/statefulset-with-annotations/00-assert.yaml +++ b/tests/operator/statefulset-with-annotations/00-assert.yaml @@ -10,6 +10,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: statefulset-with-annotations-0 +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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..51c9a7d1 100644 --- a/tests/sidecar/pod-with-sidecar/00-assert.yaml +++ b/tests/sidecar/pod-with-sidecar/00-assert.yaml @@ -9,6 +9,12 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert collectors: - pod: example-with-tailling-sidecars +- selector: app.kubernetes.io/name=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 +- selector: control-plane=tailing-sidecar-operator + namespace: tailing-sidecar-system + tail: 100 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 ]"