Skip to content

Commit

Permalink
CASMPET-7273: k8s-verify-cluster: Allow etcdbackup pods in states oth…
Browse files Browse the repository at this point in the history
…er than Running and Completed (#632)

(cherry picked from commit ef3654e)

Co-authored-by: Mitch Harding (the weird one) <[email protected]>
  • Loading branch information
github-actions[bot] and mharding-hpe authored Nov 21, 2024
1 parent 22c814e commit 50665ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions goss-testing/tests/ncn/goss-k8s-verify-cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# MIT License
#
# (C) Copyright 2014-2022 Hewlett Packard Enterprise Development LP
# (C) Copyright 2014-2022, 2024 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -53,9 +53,14 @@ command:
meta:
desc: All Kubernetes kube-system namespace pods are Running or Completed.
sev: 0
# Look for pods that are not Running or Completed
# However, we do allow etcdbackup job pods to be in other "normal" lifecycle states
exec: |-
"{{$logrun}}" -l "{{$testlabel_2}}" \
"{{$kubectl}}" get po -n kube-system --no-headers | grep -Ev 'Running|Completed'
"{{$kubectl}}" get po -n kube-system --no-headers \
| awk '{ print $1" "$3 }' \
| grep -Ev ' (Running|Completed)$' \
| grep -Ev '-etcdbackup-.* (ContainerCreating|Init:[0-9]+/[0-9]+|NotReady|Pending|PodInitializing|Terminating)$'
# We expect no output and for the grep command to return non-0
stdout:
- "!/./"
Expand Down

0 comments on commit 50665ac

Please sign in to comment.