-
Notifications
You must be signed in to change notification settings - Fork 4.8k
OCPEDGE-2491: Log pcs status and etcd member list after every recovery #30949
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -78,6 +78,11 @@ var _ = g.Describe("[sig-etcd][apigroup:config.openshift.io][OCPFeatureGate:Dual | |||||||||||||||||
| peerNode = nodes.Items[randomIndex] | ||||||||||||||||||
| // Select the remaining index | ||||||||||||||||||
| targetNode = nodes.Items[(randomIndex+1)%len(nodes.Items)] | ||||||||||||||||||
|
|
||||||||||||||||||
| // Log final pcs and etcd status after every test (pass or fail) via SSH | ||||||||||||||||||
| g.DeferCleanup(func() { | ||||||||||||||||||
| logFinalClusterStatus([]corev1.Node{peerNode, targetNode}) | ||||||||||||||||||
| }) | ||||||||||||||||||
| }) | ||||||||||||||||||
|
|
||||||||||||||||||
| g.It("should recover from graceful node shutdown with etcd member re-addition", func() { | ||||||||||||||||||
|
|
@@ -778,6 +783,74 @@ func restartVms(dataPair []vmNodePair, c hypervisorExtendedConfig) { | |||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| // logFinalClusterStatus logs pcs status and etcd member list via SSH after every test | ||||||||||||||||||
| // (pass or fail). Uses the hypervisor SSH path because the Kubernetes API may not be | ||||||||||||||||||
| // available after a recovery test. Errors are logged but never fail the test. | ||||||||||||||||||
| func logFinalClusterStatus(nodes []corev1.Node) { | ||||||||||||||||||
| if !exutil.HasHypervisorConfig() { | ||||||||||||||||||
| return | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| sshConfig := exutil.GetHypervisorConfig() | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit:
Suggested change
|
||||||||||||||||||
| hypervisorConfig := core.SSHConfig{ | ||||||||||||||||||
| IP: sshConfig.HypervisorIP, | ||||||||||||||||||
| User: sshConfig.SSHUser, | ||||||||||||||||||
| PrivateKeyPath: sshConfig.PrivateKeyPath, | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| if _, err := os.Stat(hypervisorConfig.PrivateKeyPath); os.IsNotExist(err) { | ||||||||||||||||||
| framework.Logf("Skipping final cluster status: private key not found at %s", hypervisorConfig.PrivateKeyPath) | ||||||||||||||||||
| return | ||||||||||||||||||
| } | ||||||||||||||||||
|
||||||||||||||||||
| if _, err := os.Stat(hypervisorConfig.PrivateKeyPath); os.IsNotExist(err) { | |
| framework.Logf("Skipping final cluster status: private key not found at %s", hypervisorConfig.PrivateKeyPath) | |
| return | |
| } | |
| if _, err := os.Stat(hypervisorConfig.PrivateKeyPath); err != nil { | |
| framework.Logf("Skipping final cluster status: cannot access private key at %s: %v", hypervisorConfig.PrivateKeyPath, err) | |
| return | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: a reader seeing both this and
deferDiagnosticsOnFailurein theItblocks may wonder about redundancy. Consider clarifying: