-
Notifications
You must be signed in to change notification settings - Fork 4.8k
tests: run restore etcd from snapshot test using a new subcommand #23080
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
Conversation
0e86dec to
71f5c03
Compare
|
/cc @hexfusion @runcom |
hexfusion
left a comment
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.
Wow this looks great, just few notes on first pass. I will test a bit and let you know if anything else pops up.
| _, err = oc.Run("create").Args("-n", ns, "secret", "generic", "ssh-host-keys", "--from-file", secretKeyArgs).Output() | ||
| o.Expect(err).NotTo(o.HaveOccurred()) | ||
| } else { | ||
| o.Expect(err).NotTo(o.HaveOccurred()) |
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.
Regarding the scope of err just making sure you are intended to report on err from
_, err = oc.AdminKubeClient().CoreV1().Secrets(ns).Get("ssh-host-keys", metav1.GetOptions{}) on line 137
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.
Yeah, that's intended. "not found" error would be skipped and the secret would be created, thus two expects in different scopes.
Perhaps in-scope err should be renamed for clarity, wdyt?
| } | ||
|
|
||
| func constructEtcdConnectionString(masters []string, proxy string) string { | ||
| //TODO vrutkovs: replace this nonsense with `etcdctl member list -w json ...` |
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.
+1 :)
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.
I will hack on this.
This test is equivalent to bash function in CI's installer template. It runs in a dedicated subcommand and ensure cluster state is properly being restored after etcd snapshot restore procedure.
7b66bdf to
65bf6f1
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vrutkovs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| } | ||
|
|
||
| func initDRSnapshotRestore(value string) error { | ||
| if len(value) == 0 { |
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 if value == ""
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
if value == ""
project standard is to use len. If you have instances of the == "" please update to match the kube/openshift standard.
|
/cc @smarterclayton Rewrote DR restore from snapshot scenario test, PTAL |
| "sudo -i install -o core -g core /root/assets/backup/snapshot.db /tmp/snapshot.db") | ||
| setMachineConfig("rollback-B.yaml", oc, mcps) | ||
|
|
||
| scpFileToHost(os.Getenv("KUBE_SSH_KEY_PATH"), proxy, "/home/core/.ssh/id_rsa", firstMaster) |
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.
Discussed this with @deads2k - the code in lines L78-95 is running when the cluster is considered to be in a bad state already.
This should be moved to a bash script, as it would be a great example for the customers of how DR is being tested in CI.
|
See #23208 |
This test is equivalent to bash function in CI's installer template.
It runs in a dedicated subcommand and ensure cluster state is properly
being restored after etcd snapshot restore procedure.
TODO:
installer: add a function to run dr snapshot restore e2e test release#3998