diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-1.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-1.yaml index 13b5de44..4d3a1834 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-1.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-1.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-1 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-10.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-10.yaml index 338d3792..aabb9851 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-10.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-10.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-10 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-11.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-11.yaml index 83f08d7c..727288e0 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-11.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-11.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-11 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-12.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-12.yaml index ec5d9ad7..47250ab7 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-12.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-12.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-12 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-13.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-13.yaml index 4ecc4388..536e6800 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-13.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-13.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-13 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-14.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-14.yaml index 4e95a28f..ecfeee53 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-14.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-14.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-14 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-15.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-15.yaml index acb00efe..fb8191d7 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-15.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-15.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-15 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-16.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-16.yaml index 3999ae5a..abb4ae91 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-16.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-16.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-16 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-17.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-17.yaml index e451a6d6..c791fe88 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-17.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-17.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-17 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-18.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-18.yaml index 28444dae..4297f9a2 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-18.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-18.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-18 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-19.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-19.yaml index 22f48751..14951af5 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-19.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-19.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-19 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-2.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-2.yaml index d5b1a2f8..a47245dc 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-2.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-2.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-2 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-20.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-20.yaml index 1a1508bf..f1600bc4 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-20.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-20.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-20 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-3.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-3.yaml index 665b1f5e..f24c9638 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-3.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-3.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-3 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-4.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-4.yaml index d799a7fb..da338605 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-4.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-4.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-4 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-5.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-5.yaml index 586c135e..b9447e1d 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-5.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-5.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-5 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-6.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-6.yaml index a79f1015..48b26733 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-6.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-6.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-6 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-7.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-7.yaml index fce66de7..13e122fb 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-7.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-7.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-7 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-8.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-8.yaml index a8cb8801..14d639c1 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-8.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-8.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-8 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-9.yaml b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-9.yaml index 7b479eb0..63bb7fc3 100644 --- a/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-9.yaml +++ b/rdr/busybox/app-busybox-1/resources/deployment/busybox-dc-9.yaml @@ -16,6 +16,18 @@ spec: labels: workload: busybox-9 spec: + initContainers: + - name: init-integrity-check + image: quay.io/ocsci/rdr-ocs-workload + env: + - name: CONTAINER_VALUE + value: "init" + command: ['sh', '-c'] + args: + - wget https://raw.githubusercontent.com/red-hat-storage/ocs-workloads/master/rdr/busybox/scripts/simple_io_integrity_check.sh -O /mnt/simple_io_integrity_check.sh; chmod +x /mnt/simple_io_integrity_check.sh; /mnt/simple_io_integrity_check.sh + volumeMounts: + - mountPath: /mnt/test + name: mypvc containers: - command: ["/bin/sh", "-c"] args: diff --git a/rdr/busybox/scripts/simple_io_integrity_check.sh b/rdr/busybox/scripts/simple_io_integrity_check.sh index c93ae941..05ac69c5 100644 --- a/rdr/busybox/scripts/simple_io_integrity_check.sh +++ b/rdr/busybox/scripts/simple_io_integrity_check.sh @@ -4,8 +4,24 @@ if [ -f "$HASHFILE" ]; then echo "Found hashfile" else echo "Hashfile not found, can't continue with integrity check" - exit 1 + if [ "$CONTAINER_VALUE" == "init" ] + then + exit 0 + else + exit 1 + fi +fi +if [ "$CONTAINER_VALUE" == "init" ] +then + md5sum -c $HASHFILE +else + md5sum -c --quiet $HASHFILE fi -md5sum -c --quiet $HASHFILE -exit $? +retVal=$? +if [ $retVal -ne 0 ]; then + echo "Error" +else + echo "Integrity checked Passed" +fi +exit $retVal