Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
test: add delete-deployment.sh
Browse files Browse the repository at this point in the history
The script removes all deployed PMEM-CSI objects, regardless of the
namespace. This mirrors what deploy.go does when cleaning up a
cluster.
  • Loading branch information
pohly committed Jan 15, 2021
1 parent 74f44f1 commit 967b966
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/delete-deployment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -o errexit

TEST_DIRECTORY=${TEST_DIRECTORY:-$(dirname $(readlink -f $0))}
source ${TEST_CONFIG:-${TEST_DIRECTORY}/test-config.sh}

CLUSTER=${CLUSTER:-pmem-govm}
REPO_DIRECTORY="${REPO_DIRECTORY:-$(dirname $(dirname $(readlink -f $0)))}"
CLUSTER_DIRECTORY="${CLUSTER_DIRECTORY:-${REPO_DIRECTORY}/_work/${CLUSTER}}"
SSH="${CLUSTER_DIRECTORY}/ssh.0"
KUBECTL="${SSH} kubectl" # Always use the kubectl installed in the cluster.

kinds="
deployments
replicasets
statefulsets
daemonsets
clusterrolebindings
clusterroles
crd
csidrivers
mutatingwebhookconfigurations
pods
rolebindings
roles
serviceaccounts
services
storageclasses
"
for kind in $kinds; do
echo -n "$kind: "
${KUBECTL} delete --all-namespaces -l pmem-csi.intel.com/deployment $kind
${KUBECTL} delete --all-namespaces -l app.kubernetes.io/part-of=pmem-csi $kind
done

0 comments on commit 967b966

Please sign in to comment.