mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
ci: modify kubectl_retry() to handle NotFound on delete cmd
Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 2b19197e2f
)
This commit is contained in:
parent
6a4194c701
commit
bfd5f820c5
@ -25,6 +25,18 @@ kubectl_retry() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# in case of a failure when running "delete", ignore errors with "NotFound"
|
||||
if [ "${action}" == 'delete' ]
|
||||
then
|
||||
# count lines in stderr that do not have "NotFound"
|
||||
ret=$(grep -cvw 'NotFound' "${stderr}")
|
||||
if [ "${ret}" -eq 0 ]
|
||||
then
|
||||
# Success! stderr is empty after removing all "NotFound" lines.
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
||||
retries=$((retries+1))
|
||||
if [ ${retries} -eq ${KUBECTL_RETRY} ]
|
||||
then
|
||||
|
Loading…
Reference in New Issue
Block a user