Skip to content
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

Galal hussein etcd backup restore #2154

Merged
merged 57 commits into from
Aug 28, 2020
Merged
Changes from 3 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3ead6fa
Add etcd snapshot and restore
galal-hussein Aug 12, 2020
78fd41f
fix error logs
galal-hussein Aug 12, 2020
d3575b6
goimports
galal-hussein Aug 12, 2020
4be58c5
fix flag describtion
galal-hussein Aug 12, 2020
6fa3b27
Add disable snapshot and retention
galal-hussein Aug 13, 2020
76216ac
use creation time for snapshot retention
galal-hussein Aug 14, 2020
c3ae60f
resolve merge conflicts
briandowns Aug 22, 2020
31a9b6f
unexport method, update var name
briandowns Aug 22, 2020
a580089
adjust snapshot flags
briandowns Aug 22, 2020
1357ac5
update var name, string concat
briandowns Aug 22, 2020
192a7ff
revert previous change, create constants
briandowns Aug 22, 2020
49668c6
update
briandowns Aug 22, 2020
97f11ce
updates
briandowns Aug 22, 2020
478bb0f
type assertion error checking
briandowns Aug 22, 2020
277ac51
update
briandowns Aug 22, 2020
e68ab7e
update
briandowns Aug 22, 2020
7b6d2c2
update
briandowns Aug 22, 2020
e55f556
pr remediation
briandowns Aug 22, 2020
0da7678
pr remediation
briandowns Aug 22, 2020
1482fa1
pr remediation
briandowns Aug 22, 2020
114ae91
pr remediation
briandowns Aug 22, 2020
f5ef1cd
pr remediation
briandowns Aug 22, 2020
cc76bdd
updates
briandowns Aug 23, 2020
2029725
updates
briandowns Aug 23, 2020
a36a8c2
simplify logic, remove unneeded function
briandowns Aug 23, 2020
1d95248
update flags
briandowns Aug 23, 2020
d5974f4
update flags
briandowns Aug 23, 2020
3c5b45b
add comment
briandowns Aug 24, 2020
d50cde8
exit on restore completion, update flag names, move retention check
briandowns Aug 24, 2020
34696c1
exit on restore completion, update flag names, move retention check
briandowns Aug 24, 2020
ce1951d
exit on restore completion, update flag names, move retention check
briandowns Aug 24, 2020
b485390
update disable snapshots flag and field names
briandowns Aug 24, 2020
0e181e7
move function
briandowns Aug 24, 2020
5e177bf
update field names
briandowns Aug 24, 2020
a073469
update var and field names
briandowns Aug 25, 2020
79ad3d4
update var and field names
briandowns Aug 26, 2020
b3a7979
update defaultSnapshotIntervalMinutes to 12 like rke
briandowns Aug 26, 2020
1fbad2d
update directory perms
briandowns Aug 26, 2020
ed06bfb
update etc-snapshot-dir usage
briandowns Aug 26, 2020
d56abbe
update interval to 12 hours
briandowns Aug 26, 2020
1286897
fix usage typo
briandowns Aug 27, 2020
a6a4d54
add cron
briandowns Aug 28, 2020
8ad24ad
add cron
briandowns Aug 28, 2020
67166b2
add cron
briandowns Aug 28, 2020
c077736
wire in cron
briandowns Aug 28, 2020
330c19d
wire in cron
briandowns Aug 28, 2020
c4a83d6
wire in cron
briandowns Aug 28, 2020
6e234dd
wire in cron
briandowns Aug 28, 2020
17a08c7
wire in cron
briandowns Aug 28, 2020
7ccc390
wire in cron
briandowns Aug 28, 2020
30da757
wire in cron
briandowns Aug 28, 2020
b877501
update deps target to work, add build/data target for creation, and g…
briandowns Aug 28, 2020
f839e08
remove dead make targets
briandowns Aug 28, 2020
a940f74
error handling, cluster reset functionality
briandowns Aug 28, 2020
969cab1
error handling, cluster reset functionality
briandowns Aug 28, 2020
4d6002d
update
briandowns Aug 28, 2020
469d100
remove intermediate dapper file
briandowns Aug 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,16 @@ func snapshotRetention(retention int, snapshotDir string) error {
return nil
}
sort.Slice(snapshotFiles, func(i, j int) bool {
briandowns marked this conversation as resolved.
Show resolved Hide resolved
fileISec, ok := snapshotFiles[i].Sys().(*syscall.Stat_t).Ctim.Unix()
v, ok := snapshotFiles[i].Sys().(*syscall.Stat_t)
if !ok {
logrus.Fatal("type assertion failed. expected: *syscall.Stat_t")
briandowns marked this conversation as resolved.
Show resolved Hide resolved
}
fileJSec, _ := snapshotFiles[j].Sys().(*syscall.Stat_t).Ctim.Unix()
fileISec, _ := v.Ctim.Unix()
v, ok = snapshotFiles[j].Sys().(*syscall.Stat_t)
if !ok {
logrus.Fatal("type assertion failed. expected: *syscall.Stat_t")
briandowns marked this conversation as resolved.
Show resolved Hide resolved
}
fileJSec, _ := v.Ctim.Unix()
return int(fileISec) < int(fileJSec)
})
for _, snapshot := range snapshotFiles[:len(snapshotFiles)-retention] {
Expand Down