From 18868c409ca1f04a306e26e40dd7805a4b637569 Mon Sep 17 00:00:00 2001 From: Predrag Knezevic Date: Thu, 6 Nov 2025 17:06:06 +0100 Subject: [PATCH 1/2] Add health probes to test-operator bundles Enhance test-operator v1.0.0 and v1.2.0 bundles with HTTP-based health probes to enable testing of startup, liveness, and readiness probe behavior. Replaces the simple sleep container with a busybox httpd server that exposes probe endpoints via a ConfigMap-mounted script. The probes can be flipped from true to false by executing `rm /var/www{stared,ready,live}` and back to true by performin `touch /var/www{stared,ready,live}` --- .../v1.0.0/manifests/script.configmap.yaml | 11 ++++++ .../testoperator.clusterserviceversion.yaml | 38 +++++++++++++++---- .../v1.2.0/manifests/script.configmap.yaml | 12 ++++++ .../testoperator.clusterserviceversion.yaml | 38 +++++++++++++++---- 4 files changed, 85 insertions(+), 14 deletions(-) create mode 100644 testdata/images/bundles/test-operator/v1.0.0/manifests/script.configmap.yaml create mode 100644 testdata/images/bundles/test-operator/v1.2.0/manifests/script.configmap.yaml diff --git a/testdata/images/bundles/test-operator/v1.0.0/manifests/script.configmap.yaml b/testdata/images/bundles/test-operator/v1.0.0/manifests/script.configmap.yaml new file mode 100644 index 000000000..a0404835a --- /dev/null +++ b/testdata/images/bundles/test-operator/v1.0.0/manifests/script.configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: httpd-script +data: + httpd.sh: | + #!/bin/sh + echo true > /var/www/started + echo true > /var/www/ready + echo true > /var/www/live + exec httpd -f -h /var/www -p 80 diff --git a/testdata/images/bundles/test-operator/v1.0.0/manifests/testoperator.clusterserviceversion.yaml b/testdata/images/bundles/test-operator/v1.0.0/manifests/testoperator.clusterserviceversion.yaml index 4cb49d5fe..bc6cd77d2 100644 --- a/testdata/images/bundles/test-operator/v1.0.0/manifests/testoperator.clusterserviceversion.yaml +++ b/testdata/images/bundles/test-operator/v1.0.0/manifests/testoperator.clusterserviceversion.yaml @@ -56,15 +56,39 @@ spec: app: olme2etest spec: terminationGracePeriodSeconds: 0 + volumes: + - name: scripts + configMap: + name: httpd-script + defaultMode: 0755 containers: - - name: busybox + - name: busybox-httpd-container image: busybox:1.36 - command: - - 'sleep' - - '1000' - securityContext: - runAsUser: 1000 - runAsNonRoot: true + command: ["/scripts/httpd.sh"] + ports: + - containerPort: 80 + volumeMounts: + - name: scripts + mountPath: /scripts + readOnly: true + startupProbe: + httpGet: + path: /started + port: 80 + failureThreshold: 30 + periodSeconds: 10 + livenessProbe: + httpGet: + path: /live + port: 80 + failureThreshold: 1 + periodSeconds: 2 + readinessProbe: + httpGet: + path: /ready + port: 80 + initialDelaySeconds: 1 + periodSeconds: 1 serviceAccountName: simple-bundle-manager clusterPermissions: - rules: diff --git a/testdata/images/bundles/test-operator/v1.2.0/manifests/script.configmap.yaml b/testdata/images/bundles/test-operator/v1.2.0/manifests/script.configmap.yaml new file mode 100644 index 000000000..6270e4ad7 --- /dev/null +++ b/testdata/images/bundles/test-operator/v1.2.0/manifests/script.configmap.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: httpd-script +data: + httpd.sh: | + #!/bin/sh + echo "Version 1.2.0" + echo true > /var/www/started + echo true > /var/www/ready + echo true > /var/www/live + exec httpd -f -h /var/www -p 80 diff --git a/testdata/images/bundles/test-operator/v1.2.0/manifests/testoperator.clusterserviceversion.yaml b/testdata/images/bundles/test-operator/v1.2.0/manifests/testoperator.clusterserviceversion.yaml index 90621bc6d..9cb819615 100644 --- a/testdata/images/bundles/test-operator/v1.2.0/manifests/testoperator.clusterserviceversion.yaml +++ b/testdata/images/bundles/test-operator/v1.2.0/manifests/testoperator.clusterserviceversion.yaml @@ -56,15 +56,39 @@ spec: app: olme2etest spec: terminationGracePeriodSeconds: 0 + volumes: + - name: scripts + configMap: + name: httpd-script + defaultMode: 0755 containers: - - name: busybox + - name: busybox-httpd-container image: busybox:1.37 - command: - - 'sleep' - - '1000' - securityContext: - runAsUser: 1000 - runAsNonRoot: true + command: ["/scripts/httpd.sh"] + ports: + - containerPort: 80 + volumeMounts: + - name: scripts + mountPath: /scripts + readOnly: true + startupProbe: + httpGet: + path: /started + port: 80 + failureThreshold: 30 + periodSeconds: 10 + livenessProbe: + httpGet: + path: /live + port: 80 + failureThreshold: 1 + periodSeconds: 2 + readinessProbe: + httpGet: + path: /ready + port: 80 + initialDelaySeconds: 1 + periodSeconds: 1 serviceAccountName: simple-bundle-manager clusterPermissions: - rules: From 81c3cabbc844544201ab71dcac9ba36f40da47d3 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Mon, 10 Nov 2025 10:53:13 +0100 Subject: [PATCH 2/2] Adjust serviceAccount indent in ClusterServiceVersion Signed-off-by: Per Goncalves da Silva --- .../v1.0.0/manifests/testoperator.clusterserviceversion.yaml | 2 +- .../v1.2.0/manifests/testoperator.clusterserviceversion.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testdata/images/bundles/test-operator/v1.0.0/manifests/testoperator.clusterserviceversion.yaml b/testdata/images/bundles/test-operator/v1.0.0/manifests/testoperator.clusterserviceversion.yaml index bc6cd77d2..ae6fadca9 100644 --- a/testdata/images/bundles/test-operator/v1.0.0/manifests/testoperator.clusterserviceversion.yaml +++ b/testdata/images/bundles/test-operator/v1.0.0/manifests/testoperator.clusterserviceversion.yaml @@ -89,7 +89,7 @@ spec: port: 80 initialDelaySeconds: 1 periodSeconds: 1 - serviceAccountName: simple-bundle-manager + serviceAccountName: simple-bundle-manager clusterPermissions: - rules: - apiGroups: diff --git a/testdata/images/bundles/test-operator/v1.2.0/manifests/testoperator.clusterserviceversion.yaml b/testdata/images/bundles/test-operator/v1.2.0/manifests/testoperator.clusterserviceversion.yaml index 9cb819615..6fc91adf3 100644 --- a/testdata/images/bundles/test-operator/v1.2.0/manifests/testoperator.clusterserviceversion.yaml +++ b/testdata/images/bundles/test-operator/v1.2.0/manifests/testoperator.clusterserviceversion.yaml @@ -149,7 +149,7 @@ spec: verbs: - create - patch - serviceAccountName: simple-bundle-manager + serviceAccountName: simple-bundle-manager strategy: deployment installModes: - supported: false