Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: fix formatting of long usage messages #349

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions cli/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
18 changes: 8 additions & 10 deletions cli/cmd/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
16 changes: 7 additions & 9 deletions cli/cmd/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down