Skip to content

Commit

Permalink
add additional logging to redeploy to help understand state when this…
Browse files Browse the repository at this point in the history
… job fails in e2e
  • Loading branch information
arborite-rh authored and m1kola committed Feb 23, 2022
1 parent fe34bfc commit ea03726
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/e2e/adminapi_redeployvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ var _ = Describe("[Admin API] VM redeploy action", func() {
Expect(err).NotTo(HaveOccurred())
Expect(vms).NotTo(HaveLen(0))
vm := vms[0]
log.Infof("selected vm: %s", *vm.Name)

By("triggering the redeploy action")
clockDrift := -1 * time.Minute
Expand Down Expand Up @@ -67,19 +68,18 @@ var _ = Describe("[Admin API] VM redeploy action", func() {
var nodeNotReady, rebooted, nodeReady bool

for _, event := range events.Items {
if event.CreationTimestamp.After(nodeKillTime.Time) {
if !nodeNotReady &&
event.Reason == "NodeNotReady" &&
event.Regarding.Name == *vm.Name {
if event.CreationTimestamp.After(nodeKillTime.Time) && event.Regarding.Name == *vm.Name {
if !nodeNotReady && event.Reason == "NodeNotReady" {
nodeNotReady = true
} else if !rebooted &&
event.Reason == "Rebooted" &&
event.Regarding.Name == *vm.Name {
log.Info("node entered not ready state")
}
if !rebooted && event.Reason == "Rebooted" {
rebooted = true
} else if !nodeReady &&
event.Reason == "NodeReady" &&
event.Regarding.Name == *vm.Name {
log.Info("node reboooted")
}
if !nodeReady && event.Reason == "NodeReady" {
nodeReady = true
log.Info("node returned to ready state")
break
}
}
Expand Down

0 comments on commit ea03726

Please sign in to comment.