diff --git a/pkg/cmd/cli/backuplocation/backup_location.go b/pkg/cmd/cli/backuplocation/backup_location.go index 0ed814efe..423868985 100644 --- a/pkg/cmd/cli/backuplocation/backup_location.go +++ b/pkg/cmd/cli/backuplocation/backup_location.go @@ -1,5 +1,5 @@ /* -Copyright 2018 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/cmd/cli/restic/repo/get.go b/pkg/cmd/cli/restic/repo/get.go index a58f77832..8fd848fd4 100644 --- a/pkg/cmd/cli/restic/repo/get.go +++ b/pkg/cmd/cli/restic/repo/get.go @@ -1,5 +1,5 @@ /* -Copyright 2018 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -59,7 +59,7 @@ func NewGetCommand(f client.Factory, use string) *cobra.Command { }, } - c.Flags().StringVarP(&listOptions.LabelSelector, "selector", "l", listOptions.LabelSelector, "only show items matching this label selector") + c.Flags().StringVarP(&listOptions.LabelSelector, "selector", "l", listOptions.LabelSelector, "Only show items matching this label selector.") output.BindFlags(c.Flags()) diff --git a/pkg/cmd/cli/restic/repo/repo.go b/pkg/cmd/cli/restic/repo/repo.go index 2f754d869..8665b9b7b 100644 --- a/pkg/cmd/cli/restic/repo/repo.go +++ b/pkg/cmd/cli/restic/repo/repo.go @@ -1,5 +1,5 @@ /* -Copyright 2018 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/cmd/cli/restic/restic.go b/pkg/cmd/cli/restic/restic.go index 39909c23c..c161d72e6 100644 --- a/pkg/cmd/cli/restic/restic.go +++ b/pkg/cmd/cli/restic/restic.go @@ -1,5 +1,5 @@ /* -Copyright 2018 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/cmd/cli/restic/server.go b/pkg/cmd/cli/restic/server.go index 60e7ca4de..be3c34889 100644 --- a/pkg/cmd/cli/restic/server.go +++ b/pkg/cmd/cli/restic/server.go @@ -1,5 +1,5 @@ /* -Copyright 2019 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -81,8 +81,8 @@ func NewServerCommand(f client.Factory) *cobra.Command { }, } - command.Flags().Var(logLevelFlag, "log-level", fmt.Sprintf("the level at which to log. Valid values are %s.", strings.Join(logLevelFlag.AllowedValues(), ", "))) - command.Flags().Var(formatFlag, "log-format", fmt.Sprintf("the format for log output. Valid values are %s.", strings.Join(formatFlag.AllowedValues(), ", "))) + command.Flags().Var(logLevelFlag, "log-level", fmt.Sprintf("The level at which to log. Valid values are %s.", strings.Join(logLevelFlag.AllowedValues(), ", "))) + command.Flags().Var(formatFlag, "log-format", fmt.Sprintf("The format for log output. Valid values are %s.", strings.Join(formatFlag.AllowedValues(), ", "))) return command } diff --git a/pkg/cmd/cli/restic/server_test.go b/pkg/cmd/cli/restic/server_test.go index 1087804d8..31cd79cd7 100644 --- a/pkg/cmd/cli/restic/server_test.go +++ b/pkg/cmd/cli/restic/server_test.go @@ -1,5 +1,5 @@ /* -Copyright 2019 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/cmd/cli/restore/create.go b/pkg/cmd/cli/restore/create.go index f5a32d7ef..2e051535a 100644 --- a/pkg/cmd/cli/restore/create.go +++ b/pkg/cmd/cli/restore/create.go @@ -1,5 +1,5 @@ /* -Copyright 2017 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -44,19 +44,19 @@ func NewCreateCommand(f client.Factory, use string) *cobra.Command { c := &cobra.Command{ Use: use + " [RESTORE_NAME] [--from-backup BACKUP_NAME | --from-schedule SCHEDULE_NAME]", Short: "Create a restore", - Example: ` # create a restore named "restore-1" from backup "backup-1" + Example: ` # Create a restore named "restore-1" from backup "backup-1." velero restore create restore-1 --from-backup backup-1 - # create a restore with a default name ("backup-1-") from backup "backup-1" + # Create a restore with a default name ("backup-1-") from backup "backup-1." velero restore create --from-backup backup-1 - # create a restore from the latest successful backup triggered by schedule "schedule-1" + # Create a restore from the latest successful backup triggered by schedule "schedule-1." velero restore create --from-schedule schedule-1 - # create a restore from the latest successful OR partially-failed backup triggered by schedule "schedule-1" + # Create a restore from the latest successful OR partially-failed backup triggered by schedule "schedule-1." velero restore create --from-schedule schedule-1 --allow-partially-failed - # create a restore for only persistentvolumeclaims and persistentvolumes within a backup + # Create a restore for only persistentvolumeclaims and persistentvolumes within a backup. velero restore create --from-backup backup-2 --include-resources persistentvolumeclaims,persistentvolumes `, Args: cobra.MaximumNArgs(1), @@ -104,27 +104,27 @@ func NewCreateOptions() *CreateOptions { } func (o *CreateOptions) BindFlags(flags *pflag.FlagSet) { - flags.StringVar(&o.BackupName, "from-backup", "", "backup to restore from") - flags.StringVar(&o.ScheduleName, "from-schedule", "", "schedule to restore from") - flags.Var(&o.IncludeNamespaces, "include-namespaces", "namespaces to include in the restore (use '*' for all namespaces)") - flags.Var(&o.ExcludeNamespaces, "exclude-namespaces", "namespaces to exclude from the restore") - flags.Var(&o.NamespaceMappings, "namespace-mappings", "namespace mappings from name in the backup to desired restored name in the form src1:dst1,src2:dst2,...") - flags.Var(&o.Labels, "labels", "labels to apply to the restore") - flags.Var(&o.IncludeResources, "include-resources", "resources to include in the restore, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources)") - flags.Var(&o.ExcludeResources, "exclude-resources", "resources to exclude from the restore, formatted as resource.group, such as storageclasses.storage.k8s.io") - flags.VarP(&o.Selector, "selector", "l", "only restore resources matching this label selector") - f := flags.VarPF(&o.RestoreVolumes, "restore-volumes", "", "whether to restore volumes from snapshots") + flags.StringVar(&o.BackupName, "from-backup", "", "Backup to restore from") + flags.StringVar(&o.ScheduleName, "from-schedule", "", "Schedule to restore from") + flags.Var(&o.IncludeNamespaces, "include-namespaces", "Namespaces to include in the restore (use '*' for all namespaces)") + flags.Var(&o.ExcludeNamespaces, "exclude-namespaces", "Namespaces to exclude from the restore.") + flags.Var(&o.NamespaceMappings, "namespace-mappings", "Namespace mappings from name in the backup to desired restored name in the form src1:dst1,src2:dst2,...") + flags.Var(&o.Labels, "labels", "Labels to apply to the restore.") + flags.Var(&o.IncludeResources, "include-resources", "Resources to include in the restore, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources).") + flags.Var(&o.ExcludeResources, "exclude-resources", "Resources to exclude from the restore, formatted as resource.group, such as storageclasses.storage.k8s.io.") + flags.VarP(&o.Selector, "selector", "l", "Only restore resources matching this label selector.") + f := flags.VarPF(&o.RestoreVolumes, "restore-volumes", "", "Whether to restore volumes from snapshots.") // this allows the user to just specify "--restore-volumes" as shorthand for "--restore-volumes=true" // like a normal bool flag f.NoOptDefVal = "true" - f = flags.VarPF(&o.IncludeClusterResources, "include-cluster-resources", "", "include cluster-scoped resources in the restore") + f = flags.VarPF(&o.IncludeClusterResources, "include-cluster-resources", "", "Include cluster-scoped resources in the restore.") f.NoOptDefVal = "true" - f = flags.VarPF(&o.AllowPartiallyFailed, "allow-partially-failed", "", "if using --from-schedule, whether to consider PartiallyFailed backups when looking for the most recent one. This flag has no effect if not using --from-schedule.") + f = flags.VarPF(&o.AllowPartiallyFailed, "allow-partially-failed", "", "If using --from-schedule, whether to consider PartiallyFailed backups when looking for the most recent one. This flag has no effect if not using --from-schedule.") f.NoOptDefVal = "true" - flags.BoolVarP(&o.Wait, "wait", "w", o.Wait, "wait for the operation to complete") + flags.BoolVarP(&o.Wait, "wait", "w", o.Wait, "Wait for the operation to complete.") } func (o *CreateOptions) Complete(args []string, f client.Factory) error { @@ -136,7 +136,7 @@ func (o *CreateOptions) Complete(args []string, f client.Factory) error { sourceName = o.ScheduleName } - o.RestoreName = fmt.Sprintf("%s-%s", sourceName, time.Now().Format("20060102150405")) + o.RestoreName = fmt.Sprintf("%s-%s", sourceName, time.Now().Forspamat("20060102150405")) } client, err := f.Client() diff --git a/pkg/cmd/cli/restore/delete.go b/pkg/cmd/cli/restore/delete.go index 2e13bfbbf..6140c756f 100644 --- a/pkg/cmd/cli/restore/delete.go +++ b/pkg/cmd/cli/restore/delete.go @@ -1,5 +1,5 @@ /* -Copyright 2017 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -39,19 +39,19 @@ func NewDeleteCommand(f client.Factory, use string) *cobra.Command { c := &cobra.Command{ Use: fmt.Sprintf("%s [NAMES]", use), Short: "Delete restores", - Example: ` # delete a restore named "restore-1" + Example: ` # Delete a restore named "restore-1." velero restore delete restore-1 - # delete a restore named "restore-1" without prompting for confirmation + # Delete a restore named "restore-1" without prompting for confirmation. velero restore delete restore-1 --confirm - # delete restores named "restore-1" and "restore-2" + # Delete restores named "restore-1" and "restore-2." velero restore delete restore-1 restore-2 - # delete all restores labelled with foo=bar" + # Delete all restores labelled with foo=bar." velero restore delete --selector foo=bar - # delete all restores + # Delete all restores. velero restore delete --all`, Run: func(c *cobra.Command, args []string) { diff --git a/pkg/cmd/cli/restore/describe.go b/pkg/cmd/cli/restore/describe.go index 1e210a470..1796fb6d2 100644 --- a/pkg/cmd/cli/restore/describe.go +++ b/pkg/cmd/cli/restore/describe.go @@ -1,5 +1,5 @@ /* -Copyright 2017 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -84,10 +84,10 @@ func NewDescribeCommand(f client.Factory, use string) *cobra.Command { }, } - c.Flags().StringVarP(&listOptions.LabelSelector, "selector", "l", listOptions.LabelSelector, "only show items matching this label selector") - c.Flags().BoolVar(&details, "details", details, "display additional detail in the command output") + c.Flags().StringVarP(&listOptions.LabelSelector, "selector", "l", listOptions.LabelSelector, "Only show items matching this label selector.") + c.Flags().BoolVar(&details, "details", details, "Display additional detail in the command output.") c.Flags().BoolVar(&insecureSkipTLSVerify, "insecure-skip-tls-verify", insecureSkipTLSVerify, "If true, the object store's TLS certificate will not be checked for validity. This is insecure and susceptible to man-in-the-middle attacks. Not recommended for production.") - c.Flags().StringVar(&caCertFile, "cacert", caCertFile, "path to a certificate bundle to use when verifying TLS connections") + c.Flags().StringVar(&caCertFile, "cacert", caCertFile, "Path to a certificate bundle to use when verifying TLS connections.") return c } diff --git a/pkg/cmd/cli/restore/get.go b/pkg/cmd/cli/restore/get.go index c6c3e05a2..a6370b9a1 100644 --- a/pkg/cmd/cli/restore/get.go +++ b/pkg/cmd/cli/restore/get.go @@ -1,5 +1,5 @@ /* -Copyright 2017 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ func NewGetCommand(f client.Factory, use string) *cobra.Command { }, } - c.Flags().StringVarP(&listOptions.LabelSelector, "selector", "l", listOptions.LabelSelector, "only show items matching this label selector") + c.Flags().StringVarP(&listOptions.LabelSelector, "selector", "l", listOptions.LabelSelector, "Only show items matching this label selector.") output.BindFlags(c.Flags()) diff --git a/pkg/cmd/cli/restore/logs.go b/pkg/cmd/cli/restore/logs.go index 614734ae7..7cc6c37d3 100644 --- a/pkg/cmd/cli/restore/logs.go +++ b/pkg/cmd/cli/restore/logs.go @@ -1,5 +1,5 @@ /* -Copyright 2017 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -72,9 +72,9 @@ func NewLogsCommand(f client.Factory) *cobra.Command { }, } - c.Flags().DurationVar(&timeout, "timeout", timeout, "how long to wait to receive logs") + c.Flags().DurationVar(&timeout, "timeout", timeout, "How long to wait to receive logs.") c.Flags().BoolVar(&insecureSkipTLSVerify, "insecure-skip-tls-verify", insecureSkipTLSVerify, "If true, the object store's TLS certificate will not be checked for validity. This is insecure and susceptible to man-in-the-middle attacks. Not recommended for production.") - c.Flags().StringVar(&caCertFile, "cacert", caCertFile, "path to a certificate bundle to use when verifying TLS connections") + c.Flags().StringVar(&caCertFile, "cacert", caCertFile, "Path to a certificate bundle to use when verifying TLS connections.") return c } diff --git a/pkg/cmd/cli/restore/restore.go b/pkg/cmd/cli/restore/restore.go index 728c800ed..6e73a3441 100644 --- a/pkg/cmd/cli/restore/restore.go +++ b/pkg/cmd/cli/restore/restore.go @@ -1,5 +1,5 @@ /* -Copyright 2017 the Velero contributors. +Copyright 2020 the Velero contributors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.