From 7067ed07e06e3a07548b892a6ded775833b3ce22 Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Thu, 18 Apr 2024 10:48:30 +0200 Subject: [PATCH] cli: fix formatting of long usage messages --- cli/cmd/generate.go | 22 ++++++++++------------ cli/cmd/set.go | 18 ++++++++---------- cli/cmd/verify.go | 16 +++++++--------- 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/cli/cmd/generate.go b/cli/cmd/generate.go index 3ea9ad3a1b..66c6236e3f 100644 --- a/cli/cmd/generate.go +++ b/cli/cmd/generate.go @@ -35,21 +35,19 @@ func NewGenerateCmd() *cobra.Command { cmd := &cobra.Command{ Use: "generate [flags] paths...", Short: "generate policies and inject into Kubernetes resources", - Long: ` - Generate policies and inject into the given Kubernetes resources. + Long: `Generate policies and inject into the given Kubernetes resources. - This will download the referenced container images to calculate the dm-verity - hashes of the image layers. In addition, the Rego policy will be used as base - and updated with the given settings file. For each container workload, the policy - is added as an annotation to the Kubernetes YAML. +This will download the referenced container images to calculate the dm-verity +hashes of the image layers. In addition, the Rego policy will be used as base +and updated with the given settings file. For each container workload, the policy +is added as an annotation to the Kubernetes YAML. - The hashes of the policies are added to the manifest. +The hashes of the policies are added to the manifest. - If the Kubernetes YAML contains a Contrast Coordinator pod whose policy differs from - the embedded default, the generated policy will be printed to stdout, alongside a - warning message on stderr. This hash needs to be passed to the set and verify - subcommands. - `, +If the Kubernetes YAML contains a Contrast Coordinator pod whose policy differs from +the embedded default, the generated policy will be printed to stdout, alongside a +warning message on stderr. This hash needs to be passed to the set and verify +subcommands.`, RunE: runGenerate, } diff --git a/cli/cmd/set.go b/cli/cmd/set.go index 6681181d35..e8affc9c1c 100644 --- a/cli/cmd/set.go +++ b/cli/cmd/set.go @@ -35,18 +35,16 @@ func NewSetCmd() *cobra.Command { cmd := &cobra.Command{ Use: "set [flags] paths...", Short: "Set the given manifest at the coordinator", - Long: ` - Set the given manifest at the coordinator. + Long: `Set the given manifest at the coordinator. - This will connect to the given Coordinator using aTLS. During the connection - initialization, the remote attestation of the Coordinator CVM happens and - the connection will only be successful if the Coordinator conforms with the - reference values embedded into the CLI. +This will connect to the given Coordinator using aTLS. During the connection +initialization, the remote attestation of the Coordinator CVM happens and +the connection will only be successful if the Coordinator conforms with the +reference values embedded into the CLI. - After the connection is established, the manifest is set. The Coordinator - will re-generate the mesh root certificate and accept new workloads to - issuer certificates. - `, +After the connection is established, the manifest is set. The Coordinator +will re-generate the mesh root certificate and accept new workloads to +issuer certificates.`, RunE: runSet, } diff --git a/cli/cmd/verify.go b/cli/cmd/verify.go index 0c163c3277..ae9a5a4539 100644 --- a/cli/cmd/verify.go +++ b/cli/cmd/verify.go @@ -24,17 +24,15 @@ func NewVerifyCmd() *cobra.Command { cmd := &cobra.Command{ Use: "verify", Short: "Verify a contrast deployment", - Long: ` - Verify a contrast deployment. + Long: `Verify a contrast deployment. - This will connect to the given Coordinator using aTLS. During the connection - initialization, the remote attestation of the Coordinator CVM happens and - the connection will only be successful if the Coordinator conforms with the - reference values embedded into the CLI. +This will connect to the given Coordinator using aTLS. During the connection +initialization, the remote attestation of the Coordinator CVM happens and +the connection will only be successful if the Coordinator conforms with the +reference values embedded into the CLI. - After the connection is established, the CLI will request the manifest history, - all policies, and the certificates of the Coordinator certificate authority. - `, +After the connection is established, the CLI will request the manifest history, +all policies, and the certificates of the Coordinator certificate authority.`, RunE: runVerify, }