NewCmd creates the new "reset" command
()
| 29 | |
| 30 | // NewCmd creates the new "reset" command |
| 31 | func NewCmd() *cobra.Command { |
| 32 | restartCmd := &cobra.Command{ |
| 33 | Use: "reload CLUSTER", |
| 34 | Short: `Reload a cluster`, |
| 35 | Long: `Triggers a reconciliation loop for all the cluster's instances, rolling out new configurations if present.`, |
| 36 | GroupID: plugin.GroupIDCluster, |
| 37 | Args: plugin.RequiresArguments(1), |
| 38 | ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 39 | return plugin.CompleteClusters(cmd.Context(), args, toComplete), cobra.ShellCompDirectiveNoFileComp |
| 40 | }, |
| 41 | RunE: func(_ *cobra.Command, args []string) error { |
| 42 | ctx := context.Background() |
| 43 | clusterName := args[0] |
| 44 | return Reload(ctx, clusterName) |
| 45 | }, |
| 46 | } |
| 47 | |
| 48 | return restartCmd |
| 49 | } |
no test coverage detected