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

Function NewCmd

internal/cmd/manager/instance/cmd.go:41–63  ·  view source on GitHub ↗

NewCmd creates the "instance" command

()

Source from the content-addressed store, hash-verified

39
40// NewCmd creates the "instance" command
41func NewCmd() *cobra.Command {
42 cmd := &cobra.Command{
43 Use: "instance",
44 Short: "Instance management subfeatures",
45 RunE: func(_ *cobra.Command, _ []string) error {
46 return fmt.Errorf("missing subcommand")
47 },
48 PersistentPreRunE: func(_ *cobra.Command, _ []string) error {
49 return os.MkdirAll(postgres.TemporaryDirectory, 0o1777) //nolint:gosec
50 },
51 }
52
53 cmd.AddCommand(initdb.NewCmd())
54 cmd.AddCommand(join.NewCmd())
55 cmd.AddCommand(run.NewCmd())
56 cmd.AddCommand(status.NewCmd())
57 cmd.AddCommand(pgbasebackup.NewCmd())
58 cmd.AddCommand(restore.NewCmd())
59 cmd.AddCommand(restoresnapshot.NewCmd())
60 cmd.AddCommand(upgrade.NewCmd())
61
62 return cmd
63}

Callers 1

mainFunction · 0.92

Calls 8

NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92
NewCmdFunction · 0.92

Tested by

no test coverage detected