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

Commit

Permalink
sev: fixed k8s service yaml delete method
Browse files Browse the repository at this point in the history
bash (ls) regex in quotes was throwing errors and k8s services/pods were not getting cleaned up.
Service yamls weren't being deleted due to partial name including prefix file path, now trims using 'basename'.
Removed redundant TEST_DIR on the yaml file to be deleted.

Fixes: #5760

Signed-Off-By: Ryan Savino <[email protected]>
  • Loading branch information
ryansavino committed Aug 30, 2023
1 parent 7f5a015 commit 130b5ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions integration/kubernetes/confidential/sev.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ load "${TESTS_REPO_DIR}/integration/kubernetes/confidential/lib.sh"

# Delete all test services
k8s_delete_all() {
for file in $(ls "${TEST_DIR}/*.yaml") ; do
# Removing extension to get the pod name
local pod_name="${file%.*}"
kubernetes_delete_by_yaml "${pod_name}" "${TEST_DIR}/${file}"
for file in $(find "${TEST_DIR}" -name "*.yaml"); do
# Removing prefix path and file extension to get the pod partial name
local pod_partial_name=$(basename "${file%.*}")
kubernetes_delete_by_yaml "${pod_partial_name}" "${file}"
done
}

Expand Down

0 comments on commit 130b5ec

Please sign in to comment.