From 2ab641acfe4ba08f7c504179911ad4f97bda1629 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 3 Sep 2020 15:37:03 +0530 Subject: [PATCH] Minor refactor (#748) --- .../k8s/etcd-incluster-blueprint.yaml | 12 ++++++++++++ .../ocp/etcd-incluster-ocp-blueprint.yaml | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/examples/etcd/etcd-in-cluster/k8s/etcd-incluster-blueprint.yaml b/examples/etcd/etcd-in-cluster/k8s/etcd-incluster-blueprint.yaml index fe933d0d64..6035a11a61 100644 --- a/examples/etcd/etcd-in-cluster/k8s/etcd-incluster-blueprint.yaml +++ b/examples/etcd/etcd-in-cluster/k8s/etcd-incluster-blueprint.yaml @@ -15,6 +15,10 @@ actions: image: kanisterio/kanister-kubectl:1.18 command: - sh + - -o + - errexit + - -o + - pipefail - -c - | export CACERT="{{ index .Object.data "cacert" | toString | b64dec }}" @@ -36,6 +40,10 @@ actions: image: kanisterio/kanister-kubectl:1.18 command: - sh + - -o + - errexit + - -o + - pipefail - -c - | BACKUP_LOCATION=etcd_backups/{{ .Object.metadata.namespace }}/{{ toDate "2006-01-02T15:04:05.999999999Z07:00" .Time | date "2006-01-02T15:04:05Z07:00" }}/etcd-backup.db.gz @@ -50,6 +58,10 @@ actions: image: kanisterio/kanister-kubectl:1.18 command: - sh + - -o + - errexit + - -o + - pipefail - -c - | kubectl exec -it -n {{ .Phases.takeSnapshot.Output.etcdNS }} {{ .Phases.takeSnapshot.Output.etcdPod }} -c etcd -- sh -c "rm -rf /tmp/etcd-backup.db" diff --git a/examples/etcd/etcd-in-cluster/ocp/etcd-incluster-ocp-blueprint.yaml b/examples/etcd/etcd-in-cluster/ocp/etcd-incluster-ocp-blueprint.yaml index 82d543f9f6..3f91be665a 100644 --- a/examples/etcd/etcd-in-cluster/ocp/etcd-incluster-ocp-blueprint.yaml +++ b/examples/etcd/etcd-in-cluster/ocp/etcd-incluster-ocp-blueprint.yaml @@ -15,6 +15,10 @@ actions: image: kanisterio/kanister-kubectl:1.18 command: - sh + - -o + - errexit + - -o + - pipefail - -c - | export endpoints="{{ index .Object.data "endpoints" | toString | b64dec }}" @@ -34,6 +38,10 @@ actions: image: kanisterio/kanister-kubectl:1.18 command: - sh + - -o + - errexit + - -o + - pipefail - -c - | BACKUP_LOCATION=etcd_backups/{{ .Phases.takeSnapshot.Output.etcdPod }}/{{ toDate "2006-01-02T15:04:05.999999999Z07:00" .Time | date "2006-01-02T15:04:05Z07:00" }}/etcd-backup.db.gz @@ -48,6 +56,10 @@ actions: image: kanisterio/kanister-kubectl:1.18 command: - sh + - -o + - errexit + - -o + - pipefail - -c - | kubectl exec -it -n {{ .Phases.takeSnapshot.Output.etcdNS }} "{{ .Phases.takeSnapshot.Output.etcdPod }}" -c etcd -- sh -c "rm -rf /tmp/etcd-backup.db"