Skip to content

Commit

Permalink
chore(k8sReset-debugging): Capture logs from pods in CreateContainerC…
Browse files Browse the repository at this point in the history
…onfigError state (#1660)

* chore(k8sReset-debugging): Capture logs from pods in CreateContainerConfigError state

* always archive logs (for k8sReset troubleshooting)
  • Loading branch information
Marcelo R Costa authored Jul 14, 2021
1 parent 9b84c44 commit edb7471
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,12 @@ node(runOnGen3CIWorker? 'gen3-ci-worker' : 'master') {
stage('Post') {
kubeHelper.teardown(kubeLocks)
testHelper.teardown(doNotRunTests)
pipelineHelper.teardown(currentBuild.result)
if(!skipUnitTests) {
// tear down network policies deployed by the tests
kubeHelper.kube(kubectlNamespace, {
sh(script: 'kubectl --namespace="' + kubectlNamespace + '" delete networkpolicies --all', returnStatus: true);
});
pipelineHelper.teardown(currentBuild.result)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions gen3/bin/save-failed-pod-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ EOM
gen3_log_info "capturing and archiving logs from failed pods (if any)..."

# image pull errors
array_of_img_pull_errors=($(g3kubectl get pods | grep -E "ErrImagePull|ImagePullBackOff" | xargs -I {} echo {} | awk '{ print $1 }' | tr "\n" " "))
array_of_img_pull_errors=($(g3kubectl get pods | grep -E "ErrImagePull|ImagePullBackOff|CreateContainerConfigError" | xargs -I {} echo {} | awk '{ print $1 }' | tr "\n" " "))

gen3_log_info "looking for pods with ErrImagePull or ImagePullBackOff..."
gen3_log_info "looking for pods with ErrImagePull, ImagePullBackOff or CreateContainerConfigError..."

for pod in "${array_of_img_pull_errors[@]}"; do
pod_name=$(echo $pod | xargs)
Expand Down

0 comments on commit edb7471

Please sign in to comment.