Skip to content

Commit

Permalink
fix label asignment
Browse files Browse the repository at this point in the history
functions should assign values to variables instead of try to return the
output by echoing them. We can still use the echo for debugging
purposes, but the variable should be assigned by the function and used
in the other. Note that variables are not locally scoped.
  • Loading branch information
korthout committed Feb 11, 2022
1 parent ff5a190 commit 268961d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions chaos-workers/chaos-experiments/scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@ function getBrokerLabels() {
if [ "${CHAOS_SETUP}" == "cloud" ]; then
# For backwards compatability the brokers kept the gateway labels, for a statefulset the labels are not modifiable
# To still be able to distinguish the standalone gateway with the broker, the gateway got a new label.
echo "-l app.kubernetes.io/app=zeebe -l app.kubernetes.io/component=gateway"
labels="app.kubernetes.io/app=zeebe app.kubernetes.io/component=gateway"
else # helm
echo "-l app.kubernetes.io/component=zeebe-broker"
labels="app.kubernetes.io/component=zeebe-broker"
fi
echo "$labels"
}

function getGatewayLabels() {
if [ "${CHAOS_SETUP}" == "cloud" ]; then
# For backwards compatability the brokers kept the gateway labels, for a statefulset the labels are not modifiable
# To still be able to distinguish the standalone gateway with the broker, the gateway got a new label.
echo "-l app.kubernetes.io/app=zeebe -l app.kubernetes.io/component=standalone-gateway"
labels="app.kubernetes.io/app=zeebe app.kubernetes.io/component=standalone-gateway"
else # helm
echo "-l app.kubernetes.io/component=zeebe-gateway"
labels="app.kubernetes.io/component=zeebe-gateway"
fi
echo "$labels"
}

function runOnAllBrokers()
Expand Down

0 comments on commit 268961d

Please sign in to comment.