Skip to content

Commit

Permalink
Dump info on coredns when deployment rollout fails
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Sep 30, 2022
1 parent b3f7c02 commit 98f75e9
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/install/centos-7/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ Vagrant.configure("2") do |config|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
function describe-coredns {
RC=$?
if [[ $RC -ne 0 ]]; then
kubectl describe node
kubectl --namespace kube-system describe pod -l k8s-app=kube-dns
kubectl --namespace kube-system logs -l k8s-app=kube-dns
fi
exit $RC
}
trap describe-coredns EXIT
time timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns 2>/dev/null); do sleep 5; done'
SHELL
end
Expand Down
10 changes: 10 additions & 0 deletions tests/install/fedora-coreos/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ Vagrant.configure("2") do |config|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
function describe-coredns {
RC=$?
if [[ $RC -ne 0 ]]; then
kubectl describe node
kubectl --namespace kube-system describe pod -l k8s-app=kube-dns
kubectl --namespace kube-system logs -l k8s-app=kube-dns
fi
exit $RC
}
trap describe-coredns EXIT
time timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns 2>/dev/null); do sleep 5; done'
SHELL
end
Expand Down
10 changes: 10 additions & 0 deletions tests/install/opensuse-leap/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ Vagrant.configure("2") do |config|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
function describe-coredns {
RC=$?
if [[ $RC -ne 0 ]]; then
kubectl describe node
kubectl --namespace kube-system describe pod -l k8s-app=kube-dns
kubectl --namespace kube-system logs -l k8s-app=kube-dns
fi
exit $RC
}
trap describe-coredns EXIT
timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns); do sleep 5; done'
SHELL
end
Expand Down
10 changes: 10 additions & 0 deletions tests/install/opensuse-microos/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ Vagrant.configure("2") do |config|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
function describe-coredns {
RC=$?
if [[ $RC -ne 0 ]]; then
kubectl describe node
kubectl --namespace kube-system describe pod -l k8s-app=kube-dns
kubectl --namespace kube-system logs -l k8s-app=kube-dns
fi
exit $RC
}
trap describe-coredns EXIT
time timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns 2>/dev/null); do sleep 5; done'
SHELL
end
Expand Down
10 changes: 10 additions & 0 deletions tests/install/rocky-8/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ Vagrant.configure("2") do |config|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
function describe-coredns {
RC=$?
if [[ $RC -ne 0 ]]; then
kubectl describe node
kubectl --namespace kube-system describe pod -l k8s-app=kube-dns
kubectl --namespace kube-system logs -l k8s-app=kube-dns
fi
exit $RC
}
trap describe-coredns EXIT
time timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns 2>/dev/null); do sleep 5; done'
SHELL
end
Expand Down
12 changes: 11 additions & 1 deletion tests/install/ubuntu-focal/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ Vagrant.configure("2") do |config|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
function describe-coredns {
RC=$?
if [[ $RC -ne 0 ]]; then
kubectl describe node
kubectl --namespace kube-system describe pod -l k8s-app=kube-dns
kubectl --namespace kube-system logs -l k8s-app=kube-dns
fi
exit $RC
}
trap describe-coredns EXIT
time timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns 2>/dev/null); do sleep 5; done'
SHELL
end
Expand Down Expand Up @@ -97,4 +107,4 @@ Vagrant.configure("2") do |config|
v.gui = false
v.check_guest_additions = false
end
end
end
10 changes: 10 additions & 0 deletions tests/snapshotter/btrfs/opensuse-leap/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ Vagrant.configure("2") do |config|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
function describe-coredns {
RC=$?
if [[ $RC -ne 0 ]]; then
kubectl describe node
kubectl --namespace kube-system describe pod -l k8s-app=kube-dns
kubectl --namespace kube-system logs -l k8s-app=kube-dns
fi
exit $RC
}
trap describe-coredns EXIT
time timeout 300 bash -c 'while ! (kubectl --namespace kube-system rollout status --timeout 10s deploy/coredns 2>/dev/null); do sleep 5; done'
SHELL
end
Expand Down

0 comments on commit 98f75e9

Please sign in to comment.