mirror of
https://github.com/juanfont/headscale.git
synced 2025-09-25 17:51:11 +02:00
support force flag for nodes backfillips
This commit is contained in:
parent
cd704570be
commit
e8d340d644
@ -551,6 +551,9 @@ be assigned to nodes.`,
|
||||
output, _ := cmd.Flags().GetString("output")
|
||||
|
||||
confirm := false
|
||||
|
||||
force, _ := cmd.Flags().GetBool("force")
|
||||
if !force {
|
||||
prompt := &survey.Confirm{
|
||||
Message: "Are you sure that you want to assign/remove IPs to/from nodes?",
|
||||
}
|
||||
@ -558,12 +561,15 @@ be assigned to nodes.`,
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if confirm {
|
||||
}
|
||||
|
||||
|
||||
if confirm || force {
|
||||
ctx, client, conn, cancel := newHeadscaleCLIWithConfig()
|
||||
defer cancel()
|
||||
defer conn.Close()
|
||||
|
||||
changes, err := client.BackfillNodeIPs(ctx, &v1.BackfillNodeIPsRequest{Confirmed: confirm})
|
||||
changes, err := client.BackfillNodeIPs(ctx, &v1.BackfillNodeIPsRequest{Confirmed: confirm || force })
|
||||
if err != nil {
|
||||
ErrorOutput(
|
||||
err,
|
||||
|
Loading…
Reference in New Issue
Block a user