Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CASMPET-7273: k8s-verify-cluster: Allow etcdbackup pods in states other than Running and Completed #631

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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