mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	support force flag for nodes backfillips
This commit is contained in:
		
							parent
							
								
									d77874373d
								
							
						
					
					
						commit
						b4f7782fd8
					
				| @ -539,6 +539,9 @@ be assigned to nodes.`, | |||||||
| 		output, _ := cmd.Flags().GetString("output") | 		output, _ := cmd.Flags().GetString("output") | ||||||
| 
 | 
 | ||||||
| 		confirm := false | 		confirm := false | ||||||
|  | 
 | ||||||
|  | 		force, _ := cmd.Flags().GetBool("force") | ||||||
|  | 		if !force { | ||||||
| 			prompt := &survey.Confirm{ | 			prompt := &survey.Confirm{ | ||||||
| 				Message: "Are you sure that you want to assign/remove IPs to/from nodes?", | 				Message: "Are you sure that you want to assign/remove IPs to/from nodes?", | ||||||
| 			} | 			} | ||||||
| @ -546,12 +549,15 @@ be assigned to nodes.`, | |||||||
| 			if err != nil { | 			if err != nil { | ||||||
| 				return | 				return | ||||||
| 			} | 			} | ||||||
| 		if confirm { | 		} | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 		if confirm || force { | ||||||
| 			ctx, client, conn, cancel := newHeadscaleCLIWithConfig() | 			ctx, client, conn, cancel := newHeadscaleCLIWithConfig() | ||||||
| 			defer cancel() | 			defer cancel() | ||||||
| 			defer conn.Close() | 			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 { | 			if err != nil { | ||||||
| 				ErrorOutput( | 				ErrorOutput( | ||||||
| 					err, | 					err, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user