Skip to content

Commit

Permalink
chore: improve logs for snapshot cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardolins committed Jun 10, 2020
1 parent 73e7cfb commit 153df74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/rpaasinstance/rpaasinstance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ var (
"/bin/bash",
"-c",
`pods=($(kubectl -n ${SERVICE_NAME} get pod -l rpaas.extensions.tsuru.io/service-name=${SERVICE_NAME} -l rpaas.extensions.tsuru.io/instance-name=${INSTANCE_NAME} --field-selector status.phase=Running -o=jsonpath='{.items[*].metadata.name}'));
echo "${SERVICE_NAME}-${INSTANCE_NAME}-snapshot-cronjob: ${pods}"
for pod in ${pods[@]}; do
kubectl -n ${SERVICE_NAME} exec ${pod} -- ${POD_CMD};
if [[ $? == 0 ]]; then
exit 0;
fi
done
echo "No pods found";
echo "${SERVICE_NAME}-${INSTANCE_NAME}-snapshot-cronjob: No pods found";
exit 1
`}

Expand Down

0 comments on commit 153df74

Please sign in to comment.