Skip to content

Commit

Permalink
Missed a couple of formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
studenym-hpe committed Jan 2, 2025
1 parent 9fdb1bb commit 8d5d13b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Error Rolling Back Service Chart With etcd

If rolling back a service with Bitnami etcd, the `helm rollback` could fail when going from an etcd chart version 9.x to an etcd chart version 8.x.
If rolling back a service with Bitnami etcd, the `helm rollback` could fail when going from an etcd chart 9.x version to an etcd chart 8.x version.
This is because the Bitnami 9.x etcd cluster StatefulSet and Pods have the `app.kubernetes.io/component=etcd` label and the
Bitnami 8.x etcd cluster StatefulSet and Pods do not, causing the StatefulSet to complain on rollback.

Expand Down
6 changes: 3 additions & 3 deletions troubleshooting/scripts/remove_label_from_etcd_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ label_key="app.kubernetes.io/component"
label_value="etcd"
label="${label_key}=${label_value}"

if ! kubectl get endpoints ${cluster}-etcd-client -n ${ns} -o json > /dev/null 2>&1 ; then
if ! kubectl get endpoints ${cluster}-etcd-client -n ${ns} -o json > /dev/null 2>&1; then
#
# There is no old etcd-operator managed chart installed, let's see if this
# is a fresh install or upgrade with new label.
#
has_label=$(kubectl get statefulsets.apps -n ${ns} -l ${label} --no-headers 2>/dev/null | awk "/${ss_name}/")
has_label=$(kubectl get statefulsets.apps -n ${ns} -l ${label} --no-headers 2> /dev/null | awk "/${ss_name}/")
if [ -z "$has_label" ]; then
#
# The new label has not been applied, so no need to delete label before rollback.
Expand All @@ -67,7 +67,7 @@ if ! kubectl get endpoints ${cluster}-etcd-client -n ${ns} -o json > /dev/null 2
# statefulset before rolling back.
#
members=$(kubectl get pod -n $ns -o wide -o=custom-columns=NAME:.metadata.name | awk "/${ss_name}/ && !/snapshotter|defrag/")
if [ -n "$members" ]; then
if [ -n "$members" ]; then
echo "Ensuring ${ss_name} members do not have '${label}' label for rollback to bitnami 8.x chart..."
for member in ${members}; do
echo "Removing '${label}' label from ${member}..."
Expand Down

0 comments on commit 8d5d13b

Please sign in to comment.