MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / NewCmd

Function NewCmd

internal/cmd/plugin/reload/cmd.go:31–49  ·  view source on GitHub ↗

NewCmd creates the new "reset" command

()

Source from the content-addressed store, hash-verified

29
30// NewCmd creates the new "reset" command
31func 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}

Callers 1

mainFunction · 0.92

Calls 3

RequiresArgumentsFunction · 0.92
CompleteClustersFunction · 0.92
ReloadFunction · 0.85

Tested by

no test coverage detected