Skip to content

Commit

Permalink
fix: better handling of controller type thanks @haraldkoch
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <[email protected]>
  • Loading branch information
onedr0p committed Feb 3, 2023
1 parent a6136ef commit 884934c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .taskfiles/VolSync/Tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ tasks:
controller:
sh: |
app=$(kubectl -n {{.namespace}} get persistentvolumeclaim {{.claim}} -o jsonpath="{.metadata.labels.app\.kubernetes\.io/name}")
if [[ -z $(kubectl -n {{.namespace}} get persistentvolumeclaim {{.claim}} -o jsonpath="{.metadata.annotations.volume\.kubernetes\.io/storage-provisioner}") ]]; then
echo "deployments.apps/$app" && exit 0
if kubectl -n {{ .namespace }} get deployment.apps/$app >/dev/null 2>&1 ; then
echo "deployment.apps/$app"
else
echo "statefulset.apps/$app"
fi
echo "statefulsets.apps/$app"
env: *task-vars
preconditions:
- sh: test -f {{.wipeJobTemplate}}
Expand Down

0 comments on commit 884934c

Please sign in to comment.