You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pgo/cmd/backrest.go
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -30,9 +30,10 @@ import (
30
30
31
31
varbackRestCmd=&cobra.Command{
32
32
Use: "backrest",
33
-
Short: "perform a pgbackrest action",
34
-
Long: `BACKREST performs a pgbackrest action, for example:
35
-
pgo backrest mycluster`,
33
+
Short: "Perform a pgBackRest action",
34
+
Long: `BACKREST performs a pgBackRest action. For example:
35
+
36
+
pgo backrest mycluster`,
36
37
Run: func(cmd*cobra.Command, args []string) {
37
38
log.Debug("backup called")
38
39
iflen(args) ==0&&Selector=="" {
@@ -51,8 +52,8 @@ var backRestCmd = &cobra.Command{
51
52
funcinit() {
52
53
RootCmd.AddCommand(backRestCmd)
53
54
54
-
backRestCmd.Flags().StringVarP(&Selector, "selector", "s", "", "The selector to use for cluster filtering")
55
-
backRestCmd.Flags().BoolVarP(&NoPrompt, "no-prompt", "n", false, "--no-prompt causes there to be no command line confirmation when doing a pgbackrest command")
55
+
backRestCmd.Flags().StringVarP(&Selector, "selector", "s", "", "The selector to use for cluster filtering.")
56
+
backRestCmd.Flags().BoolVarP(&NoPrompt, "no-prompt", "n", false, "No command line confirmation.")
fmt.Println("Error: You must specify either pgbasebackup or pgbackrest for the --backup-type")
52
+
fmt.Println("Error: You must specify either pgbasebackup or pgbackrest for the --backup-type.")
52
53
}
53
54
} else {
54
55
fmt.Println("Aborting...")
@@ -61,11 +62,11 @@ var backupCmd = &cobra.Command{
61
62
funcinit() {
62
63
RootCmd.AddCommand(backupCmd)
63
64
64
-
backupCmd.Flags().StringVarP(&Selector, "selector", "s", "", "The selector to use for cluster filtering")
65
-
backupCmd.Flags().StringVarP(&PVCName, "pvc-name", "", "", "The PVC name to use for the backup instead of the default backup PVC ")
66
-
backupCmd.Flags().StringVarP(&BackupType, "backup-type", "", "", "The backup type to perform, default is pgbasebackup, pgbasebackup and pgbackrest are valid backup types")
67
-
backupCmd.Flags().StringVarP(&StorageConfig, "storage-config", "", "", "The storage config to use for the backup volume ")
68
-
backupCmd.Flags().BoolVarP(&NoPrompt, "no-prompt", "n", false, "--no-prompt causes there to be no command line confirmation when doing a backup command")
65
+
backupCmd.Flags().StringVarP(&Selector, "selector", "s", "", "The selector to use for cluster filtering.")
66
+
backupCmd.Flags().StringVarP(&PVCName, "pvc-name", "", "", "The PVC name to use for the backup instead of the default.")
67
+
backupCmd.Flags().StringVarP(&StorageConfig, "storage-config", "", "", "The name of a Storage config in pgo.yaml to use for the cluster storage.")
68
+
backupCmd.Flags().BoolVarP(&NoPrompt, "no-prompt", "n", false, "No command line confirmation.")
69
+
backupCmd.Flags().StringVarP(&BackupType, "backup-type", "", "", "The backup type to perform. Default is pgbasebackup, and both pgbasebackup and pgbackrest are valid backup types.")
fmt.Println(`Error: --selector is required to create a user`)
138
+
fmt.Println(`Error: The --selector flag is required to create a user.`)
139
139
return
140
140
}
141
141
142
142
iflen(args) ==0 {
143
-
fmt.Println(`Error: a user name is required for this command`)
143
+
fmt.Println(`Error: A user name is required for this command.`)
144
144
} else {
145
145
createUser(args)
146
146
}
@@ -154,32 +154,33 @@ func init() {
154
154
CreateCmd.AddCommand(createIngestCmd)
155
155
CreateCmd.AddCommand(createUserCmd)
156
156
157
-
createIngestCmd.Flags().StringVarP(&IngestConfig, "ingest-config", "i", "", "The path of an ingest configuration file")
158
-
createClusterCmd.Flags().BoolVarP(&PgpoolFlag, "pgpool", "", false, "If set, will cause the crunchy-pgpool container to be added to the database cluster")
159
-
createClusterCmd.Flags().BoolVarP(&BackrestFlag, "pgbackrest", "", false, "If set, will cause a pgbackrest volume to be enabled for the database cluster")
160
-
createClusterCmd.Flags().BoolVarP(&ArchiveFlag, "archive", "", false, "If set, will cause archive logging to be enabled for the database cluster")
157
+
createClusterCmd.Flags().BoolVarP(&BackrestFlag, "pgbackrest", "", false, "Enables a pgBackRest volume for the database pod.")
158
+
createClusterCmd.Flags().BoolVarP(&BadgerFlag, "pgbadger", "", false, "Adds the crunchy-pgbadger container to the database pod.")
159
+
createIngestCmd.Flags().StringVarP(&IngestConfig, "ingest-config", "i", "", "Defines the path of an ingest configuration file.")
160
+
createClusterCmd.Flags().BoolVarP(&PgpoolFlag, "pgpool", "", false, "Adds the crunchy-pgpool container to the database pod.")
161
+
createClusterCmd.Flags().BoolVarP(&ArchiveFlag, "archive", "", false, "Enables archive logging for the database cluster.")
161
162
createClusterCmd.Flags().StringVarP(&PgpoolSecret, "pgpool-secret", "", "", "The name of a pgpool secret to use for the pgpool configuration.")
162
-
createClusterCmd.Flags().BoolVarP(&MetricsFlag, "metrics", "m", false, "If set, will cause the crunchy-collect container to be added to the database pod")
163
-
createClusterCmd.Flags().BoolVarP(&BadgerFlag, "pgbadger", "", false, "If set, will cause the crunchy-pgbadger container to be added to the database pod")
164
-
createClusterCmd.Flags().BoolVarP(&AutofailFlag, "autofail", "", false, "If set, will cause the autofailover to be enabled on this cluster")
165
-
createClusterCmd.Flags().StringVarP(&CustomConfig, "custom-config", "g", "", "The name of a configMap that holds custom PG config files used to override the defaults")
163
+
createClusterCmd.Flags().BoolVarP(&MetricsFlag, "metrics", "m", false, "Adds the crunchy-collect container to the database pod.")
164
+
createClusterCmd.Flags().BoolVarP(&AutofailFlag, "autofail", "", false, "If set, will cause autofailover to be enabled on this cluster.")
165
+
createClusterCmd.Flags().StringVarP(&CustomConfig, "custom-config", "g", "", "The name of a configMap that holds custom PostgreSQL configuration files used to override defaults.")
166
166
createClusterCmd.Flags().StringVarP(&StorageConfig, "storage-config", "", "", "The name of a Storage config in pgo.yaml to use for the cluster storage.")
167
167
createClusterCmd.Flags().StringVarP(&ReplicaStorageConfig, "replica-storage-config", "", "", "The name of a Storage config in pgo.yaml to use for the cluster replica storage.")
168
-
createClusterCmd.Flags().StringVarP(&NodeLabel, "node-label", "", "", "The node label (key=value) to use in placing the primary database, if not set any node is used")
169
-
createClusterCmd.Flags().StringVarP(&ServiceType, "service-type", "", "", "The service type to use in the Service for the PG cluster, if not set the pgo.yaml default will be used.")
170
-
createClusterCmd.Flags().StringVarP(&Password, "password", "w", "", "The password to use for initial database users")
171
-
createClusterCmd.Flags().StringVarP(&SecretFrom, "secret-from", "s", "", "The cluster name to use when restoring secrets")
172
-
createClusterCmd.Flags().StringVarP(&BackupPVC, "backup-pvc", "p", "", "The backup archive PVC to restore from")
173
-
createClusterCmd.Flags().StringVarP(&UserLabels, "labels", "l", "", "The labels to apply to this cluster")
174
-
createClusterCmd.Flags().StringVarP(&BackupPath, "backup-path", "x", "", "The backup archive path to restore from")
175
-
createClusterCmd.Flags().StringVarP(&PoliciesFlag, "policies", "z", "", "The policies to apply when creating a cluster, comma separated")
176
-
createClusterCmd.Flags().StringVarP(&CCPImageTag, "ccp-image-tag", "c", "", "The CCPImageTag to use for cluster creation, if specified overrides the .pgo.yaml setting")
177
-
createClusterCmd.Flags().IntVarP(&Series, "series", "e", 1, "The number of clusters to create in a series, defaults to 1")
178
-
createClusterCmd.Flags().StringVarP(&ContainerResources, "resources-config", "r", "", "The name of a container resource configuration in pgo.yaml that holds CPU and memory requests and limits")
179
-
createPolicyCmd.Flags().StringVarP(&PolicyURL, "url", "u", "", "The url to use for adding a policy")
180
-
createPolicyCmd.Flags().StringVarP(&PolicyFile, "in-file", "i", "", "The policy file path to use for adding a policy")
181
-
createUserCmd.Flags().StringVarP(&Selector, "selector", "s", "", "The selector to filter on clusters")
182
-
createUserCmd.Flags().BoolVarP(&ManagedUser, "managed", "m", false, "--managed creates a user with secrets")
183
-
createUserCmd.Flags().StringVarP(&UserDBAccess, "db", "b", "", "--db=userdb grants the user access to a database")
184
-
createUserCmd.Flags().IntVarP(&PasswordAgeDays, "valid-days", "v", 30, "--valid-days=7 sets passwords for new users to 7 days")
168
+
createClusterCmd.Flags().StringVarP(&NodeLabel, "node-label", "", "", "The node label (key=value) to use in placing the primary database. If not set, any node is used.")
169
+
createClusterCmd.Flags().StringVarP(&ServiceType, "service-type", "", "", "The Service type to use for the PostgreSQL cluster. If not set, the pgo.yaml default will be used.")
170
+
createClusterCmd.Flags().StringVarP(&Password, "password", "w", "", "The password to use for initial database users.")
171
+
createClusterCmd.Flags().StringVarP(&SecretFrom, "secret-from", "s", "", "The cluster name to use when restoring secrets.")
172
+
createClusterCmd.Flags().StringVarP(&BackupPVC, "backup-pvc", "p", "", "The backup archive PVC to restore from.")
173
+
createClusterCmd.Flags().StringVarP(&UserLabels, "labels", "l", "", "The labels to apply to this cluster.")
174
+
createClusterCmd.Flags().StringVarP(&BackupPath, "backup-path", "x", "", "The backup archive path to restore from.")
175
+
createClusterCmd.Flags().StringVarP(&PoliciesFlag, "policies", "z", "", "The policies to apply when creating a cluster, comma separated.")
176
+
createClusterCmd.Flags().StringVarP(&CCPImageTag, "ccp-image-tag", "c", "", "The CCPImageTag to use for cluster creation. If specified, overrides the pgo.yaml setting.")
177
+
createClusterCmd.Flags().IntVarP(&Series, "series", "e", 1, "The number of clusters to create in a series.")
178
+
createClusterCmd.Flags().StringVarP(&ContainerResources, "resources-config", "r", "", "The name of a container resource configuration in pgo.yaml that holds CPU and memory requests and limits.")
179
+
createPolicyCmd.Flags().StringVarP(&PolicyURL, "url", "u", "", "The url to use for adding a policy.")
180
+
createPolicyCmd.Flags().StringVarP(&PolicyFile, "in-file", "i", "", "The policy file path to use for adding a policy.")
181
+
createUserCmd.Flags().StringVarP(&Selector, "selector", "s", "", "The selector to use for cluster filtering.")
182
+
createUserCmd.Flags().BoolVarP(&ManagedUser, "managed", "m", false, "Creates a user with secrets that can be managed by the Operator.")
183
+
createUserCmd.Flags().StringVarP(&UserDBAccess, "db", "b", "", "Grants the user access to a database.")
184
+
createUserCmd.Flags().IntVarP(&PasswordAgeDays, "valid-days", "v", 30, "Sets passwords for new users to X days.")
0 commit comments