File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
operator/images/cluster-setup/content/bin Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,13 @@ install_clusters() {
143
143
check_statefulsets " tekton-results" " ${resultsStatefulsets[@]} " | indent 4
144
144
chainsDeployments=(" tekton-chains-controller" )
145
145
check_deployments " tekton-chains" " ${chainsDeployments[@]} " | indent 4
146
+
147
+ printf -- " - Checking pods status for controlplane namespaces\n"
148
+ # list of control plane namespaces
149
+ CONTROL_PLANE_NS=(" openshift-apiserver" " openshift-controller-manager" " openshift-etcd" " openshift-ingress" " openshift-kube-apiserver" " openshift-kube-controller-manager" " openshift-kube-scheduler" )
150
+ for ns in " ${CONTROL_PLANE_NS[@]} " ; do
151
+ check_crashlooping_pods " $ns " | indent 4
152
+ done
146
153
done
147
154
}
148
155
Original file line number Diff line number Diff line change @@ -113,6 +113,27 @@ check_deployments() {
113
113
done
114
114
}
115
115
116
+ check_crashlooping_pods () {
117
+ local ns=" $1 "
118
+ local crashlooping_pods
119
+
120
+ printf " checking for crashlooping pods in namsespace: %s\n" " $ns "
121
+ crashlooping_pods=$( kubectl get pods -n " $ns " --field-selector=status.phase! =Running -o jsonpath=' {range .items[?(@.status.containerStatuses[*].state.waiting.reason=="CrashLoopBackOff")]}{.metadata.name}{","}{end}' 2> /dev/null)
122
+
123
+ # Check if the any crashlooping pods found
124
+ if [[ -n $crashlooping_pods ]]; then
125
+ printf " , CrashLoopBackOff error in namespace: %s\n" " $ns "
126
+ IFS=' ,' read -ra pods <<< " $crashlooping_pods"
127
+ for pod in " ${pods[@]} " ; do
128
+ kubectl get pod " $pod " -n " $ns "
129
+ kubectl logs " $pod " -n " $ns "
130
+ done
131
+ exit 1
132
+ else
133
+ printf " , Running\n"
134
+ fi
135
+ }
136
+
116
137
check_statefulsets () {
117
138
local ns=" $1 "
118
139
shift
You can’t perform that action at this time.
0 commit comments