From 190e814b1a3ef89205d70d4cbbb28ecac1f49a8e Mon Sep 17 00:00:00 2001 From: Anthony Landreth Date: Thu, 26 Oct 2023 15:56:44 -0400 Subject: [PATCH] Slight tweak to Long message --- docs/content/reference/pgo_backup.md | 27 ++++++++++--------- .../reference/pgo_create_postgrescluster.md | 4 +-- .../reference/pgo_delete_postgrescluster.md | 4 +-- docs/content/reference/pgo_restore.md | 15 +++++++++++ docs/content/reference/pgo_restore_disable.md | 2 -- docs/content/reference/pgo_show_backup.md | 2 -- docs/content/reference/pgo_support_export.md | 2 -- docs/content/reference/pgo_version.md | 2 -- internal/cmd/backup.go | 3 +-- 9 files changed, 33 insertions(+), 28 deletions(-) diff --git a/docs/content/reference/pgo_backup.md b/docs/content/reference/pgo_backup.md index e0f76cbd..417683d2 100644 --- a/docs/content/reference/pgo_backup.md +++ b/docs/content/reference/pgo_backup.md @@ -9,7 +9,7 @@ Backup cluster Backup allows you to backup a PostgreSQL cluster either by using the current "spec.backups.pgbackrest.manual" settings on the PostgreSQL cluster -or by using flags to write your settings. Overwriting those settings requires +or by using flags to write your settings. Overwriting those settings may require the --force-conflicts flag. ### RBAC Requirements @@ -26,22 +26,25 @@ pgo backup CLUSTER_NAME [flags] ### Examples ``` - # Trigger a backup on the 'hippo' postgrescluster using the current spec options - # Note: "spec.backups.pgbackrest.manual.repoName" has to exist for the backup to begin - pgo backup hippo - - # Update the 'backups.pgbackrest.manual.repoName' and 'backups.pgbackrest.manual.options' fields - # on the 'hippo' postgrescluster and trigger a backup - pgo backup hippo --repoName="repo1" --options="--type=full" - - # Resolve ownership conflict - pgo backup hippo --force-conflicts +# Trigger a backup on the 'hippo' postgrescluster using the current spec options +# Note: "spec.backups.pgbackrest.manual.repoName" has to exist for the backup to begin +pgo backup hippo + +# Update the 'backups.pgbackrest.manual.repoName' and 'backups.pgbackrest.manual.options' fields +# on the 'hippo' postgrescluster and trigger a backup +pgo backup hippo --repoName="repo1" --options="--type=full" + +# Resolve ownership conflict +pgo backup hippo --force-conflicts + +### Example output +postgresclusters/hippo backup initiated ``` ### Options ``` - --force-conflicts take ownership and overwrite the backup annotation + --force-conflicts take ownership and overwrite the backup settings -h, --help help for backup --options stringArray options for taking a backup; can be used multiple times --repoName string repoName to backup to diff --git a/docs/content/reference/pgo_create_postgrescluster.md b/docs/content/reference/pgo_create_postgrescluster.md index aac38782..767635ea 100644 --- a/docs/content/reference/pgo_create_postgrescluster.md +++ b/docs/content/reference/pgo_create_postgrescluster.md @@ -26,9 +26,7 @@ pgo create postgrescluster CLUSTER_NAME [flags] # Create a postgrescluster pgo create postgrescluster hippo -``` -### Example output -``` +### Example output postgresclusters/hippo created ``` diff --git a/docs/content/reference/pgo_delete_postgrescluster.md b/docs/content/reference/pgo_delete_postgrescluster.md index 65e4eb6b..ccdd4981 100644 --- a/docs/content/reference/pgo_delete_postgrescluster.md +++ b/docs/content/reference/pgo_delete_postgrescluster.md @@ -26,9 +26,7 @@ pgo delete postgrescluster CLUSTER_NAME [flags] # Delete a postgrescluster pgo delete postgrescluster hippo -``` -### Example output -``` +### Example output WARNING: Deleting a postgrescluster is destructive and data retention is dependent on PV configuration. Are you sure you want to continue? (yes/no): yes postgresclusters/hippo deleted diff --git a/docs/content/reference/pgo_restore.md b/docs/content/reference/pgo_restore.md index da682652..df23b6b4 100644 --- a/docs/content/reference/pgo_restore.md +++ b/docs/content/reference/pgo_restore.md @@ -23,6 +23,21 @@ pgo restore CLUSTER_NAME [flags] ### Examples ``` +# Restore the 'hippo' cluster using the latest backup and replay all available WAL +pgo restore hippo --repoName repo1 + +# Restore the 'hippo' cluster to a specific point in time +pgo restore hippo --repoName repo1 --options '--type=time --target="2021-06-09 14:15:11-04"' + +### Example output +WARNING: You are about to restore from pgBackRest with {options:[] repoName:repo1} +WARNING: This action is destructive and PostgreSQL will be unavailable while its data is restored. + +Do you want to continue? (yes/no): yes + +# Resolve ownership conflict +pgo restore hippo --force-conflicts + ``` ### Options diff --git a/docs/content/reference/pgo_restore_disable.md b/docs/content/reference/pgo_restore_disable.md index 151b2e87..285a7943 100644 --- a/docs/content/reference/pgo_restore_disable.md +++ b/docs/content/reference/pgo_restore_disable.md @@ -28,9 +28,7 @@ pgo restore disable CLUSTER_NAME [flags] # Disable the restore section on the 'hippo' cluster pgo restore disable hippo -``` ### Example output -``` postgresclusters/hippo patched ``` diff --git a/docs/content/reference/pgo_show_backup.md b/docs/content/reference/pgo_show_backup.md index da8be1e1..f430db66 100644 --- a/docs/content/reference/pgo_show_backup.md +++ b/docs/content/reference/pgo_show_backup.md @@ -33,9 +33,7 @@ pgo show backup hippo --output=json # Show one repository of the 'hippo' postgrescluster pgo show backup hippo --repoName=repo1 -``` ### Example output -``` stanza: db status: ok cipher: none diff --git a/docs/content/reference/pgo_support_export.md b/docs/content/reference/pgo_support_export.md index 19e021de..3918d4b4 100644 --- a/docs/content/reference/pgo_support_export.md +++ b/docs/content/reference/pgo_support_export.md @@ -61,9 +61,7 @@ kubectl pgo support export daisy --output . --pg-logs-count 2 # This is only required when monitoring is not deployed in the PostgresCluster's namespace. kubectl pgo support export daisy --monitoring-namespace another-namespace --output . -``` ### Example output -``` ┌──────────────────────────────────────────────────────────────── | PGO CLI Support Export Tool | The support export tool will collect information that is diff --git a/docs/content/reference/pgo_version.md b/docs/content/reference/pgo_version.md index 36ab3414..264d02a5 100644 --- a/docs/content/reference/pgo_version.md +++ b/docs/content/reference/pgo_version.md @@ -28,9 +28,7 @@ pgo version [flags] # Request the version of the client and the operator pgo version -``` ### Example output -``` Client Version: v0.3.0 Operator Version: v5.5.0 ``` diff --git a/internal/cmd/backup.go b/internal/cmd/backup.go index 5fdf66e3..8665444c 100644 --- a/internal/cmd/backup.go +++ b/internal/cmd/backup.go @@ -37,7 +37,7 @@ func newBackupCommand(config *internal.Config) *cobra.Command { Short: "Backup cluster", Long: `Backup allows you to backup a PostgreSQL cluster either by using the current "spec.backups.pgbackrest.manual" settings on the PostgreSQL cluster -or by using flags to write your settings. Overwriting those settings requires +or by using flags to write your settings. Overwriting those settings may require the --force-conflicts flag. ### RBAC Requirements @@ -58,7 +58,6 @@ pgo backup hippo --repoName="repo1" --options="--type=full" # Resolve ownership conflict pgo backup hippo --force-conflicts -`) ### Example output postgresclusters/hippo backup initiated`)