Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
424d75ad
Unverified
Commit
424d75ad
authored
May 18, 2021
by
Brian Downs
Committed by
GitHub
May 18, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3336 from briandowns/issue-3309
Add etcd snapshot save subcommand
parents
c824c3bc
e8ecc00f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
4 deletions
+20
-4
main.go
cmd/etcdsnapshot/main.go
+2
-1
main.go
cmd/k3s/main.go
+1
-0
main.go
cmd/server/main.go
+2
-1
main.go
main.go
+2
-1
etcd_snapshot.go
pkg/cli/cmds/etcd_snapshot.go
+13
-1
No files found.
cmd/etcdsnapshot/main.go
View file @
424d75ad
...
@@ -17,7 +17,8 @@ func main() {
...
@@ -17,7 +17,8 @@ func main() {
cmds
.
NewEtcdSnapshotSubcommands
(
cmds
.
NewEtcdSnapshotSubcommands
(
etcdsnapshot
.
Delete
,
etcdsnapshot
.
Delete
,
etcdsnapshot
.
List
,
etcdsnapshot
.
List
,
etcdsnapshot
.
Prune
),
etcdsnapshot
.
Prune
,
etcdsnapshot
.
Run
),
),
),
}
}
...
...
cmd/k3s/main.go
View file @
424d75ad
...
@@ -48,6 +48,7 @@ func main() {
...
@@ -48,6 +48,7 @@ func main() {
cmds
.
NewEtcdSnapshotSubcommands
(
cmds
.
NewEtcdSnapshotSubcommands
(
etcdsnapshotCommand
,
etcdsnapshotCommand
,
etcdsnapshotCommand
,
etcdsnapshotCommand
,
etcdsnapshotCommand
,
etcdsnapshotCommand
),
etcdsnapshotCommand
),
),
),
}
}
...
...
cmd/server/main.go
View file @
424d75ad
...
@@ -47,7 +47,8 @@ func main() {
...
@@ -47,7 +47,8 @@ func main() {
cmds
.
NewEtcdSnapshotSubcommands
(
cmds
.
NewEtcdSnapshotSubcommands
(
etcdsnapshot
.
Delete
,
etcdsnapshot
.
Delete
,
etcdsnapshot
.
List
,
etcdsnapshot
.
List
,
etcdsnapshot
.
Prune
),
etcdsnapshot
.
Prune
,
etcdsnapshot
.
Run
),
),
),
}
}
...
...
main.go
View file @
424d75ad
...
@@ -31,7 +31,8 @@ func main() {
...
@@ -31,7 +31,8 @@ func main() {
cmds
.
NewEtcdSnapshotSubcommands
(
cmds
.
NewEtcdSnapshotSubcommands
(
etcdsnapshot
.
Delete
,
etcdsnapshot
.
Delete
,
etcdsnapshot
.
List
,
etcdsnapshot
.
List
,
etcdsnapshot
.
Prune
),
etcdsnapshot
.
Prune
,
etcdsnapshot
.
Run
),
),
),
}
}
...
...
pkg/cli/cmds/etcd_snapshot.go
View file @
424d75ad
...
@@ -95,7 +95,7 @@ func NewEtcdSnapshotCommand(action func(*cli.Context) error, subcommands []cli.C
...
@@ -95,7 +95,7 @@ func NewEtcdSnapshotCommand(action func(*cli.Context) error, subcommands []cli.C
}
}
}
}
func
NewEtcdSnapshotSubcommands
(
delete
,
list
,
prune
func
(
ctx
*
cli
.
Context
)
error
)
[]
cli
.
Command
{
func
NewEtcdSnapshotSubcommands
(
delete
,
list
,
prune
,
save
func
(
ctx
*
cli
.
Context
)
error
)
[]
cli
.
Command
{
return
[]
cli
.
Command
{
return
[]
cli
.
Command
{
{
{
Name
:
"delete"
,
Name
:
"delete"
,
...
@@ -127,5 +127,17 @@ func NewEtcdSnapshotSubcommands(delete, list, prune func(ctx *cli.Context) error
...
@@ -127,5 +127,17 @@ func NewEtcdSnapshotSubcommands(delete, list, prune func(ctx *cli.Context) error
Value
:
defaultSnapshotRentention
,
Value
:
defaultSnapshotRentention
,
}),
}),
},
},
{
Name
:
"save"
,
Usage
:
"Trigger an immediate etcd snapshot"
,
SkipFlagParsing
:
false
,
SkipArgReorder
:
true
,
Action
:
save
,
Flags
:
append
(
EtcdSnapshotFlags
,
&
cli
.
StringFlag
{
Name
:
"dir"
,
Usage
:
"(db) Directory to save etcd on-demand snapshot. (default: ${data-dir}/db/snapshots)"
,
Destination
:
&
ServerConfig
.
EtcdSnapshotDir
,
}),
},
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment