Skip to content
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
3 changes: 1 addition & 2 deletions cmd/kosli/attachPolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type attachPolicyOptions struct {
const attachPolicyShortDesc = `Attach a policy to one or more Kosli environments. `

const attachPolicyExample = `
# attach previously created policy to multiple environment:
# attach a previously created policy to multiple environment:
kosli attach-policy yourPolicyName \
--environment yourFirstEnvironmentName \
--environment yourSecondEnvironmentName \
Expand All @@ -36,7 +36,6 @@ func newAttachPolicyCmd(out io.Writer) *cobra.Command {
Short: attachPolicyShortDesc,
Long: attachPolicyShortDesc,
Example: attachPolicyExample,
Hidden: true,
Args: cobra.ExactArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
err := RequireGlobalFlags(global, []string{"Org", "ApiToken"})
Expand Down
5 changes: 3 additions & 2 deletions cmd/kosli/createPolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (

const createPolicyShortDesc = `Create or update a Kosli policy.`

const createPolicyLongDesc = `Updating policy content creates a new version of the policy.`

const createPolicyExample = `
# create a Kosli policy:
kosli create policy yourPolicyName \
Expand Down Expand Up @@ -44,9 +46,8 @@ func newCreatePolicyCmd(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "policy POLICY-NAME POLICY-FILE-PATH",
Short: createPolicyShortDesc,
Long: createPolicyShortDesc,
Long: createPolicyLongDesc,
Example: createPolicyExample,
Hidden: true,
Args: cobra.ExactArgs(2),
PreRunE: func(cmd *cobra.Command, args []string) error {
err := RequireGlobalFlags(global, []string{"Org", "ApiToken"})
Expand Down
3 changes: 2 additions & 1 deletion cmd/kosli/detachPolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

const detachPolicyShortDesc = `Detach a policy from one or more Kosli environments. `

const detachPolicyLongDesc = `If the environment has no more policies attached to it, then its snapshots' status will become "unknown".`

Check failure on line 19 in cmd/kosli/detachPolicy.go

View workflow job for this annotation

GitHub Actions / test / Lint

const `detachPolicyLongDesc` is unused (unused)

const detachPolicyExample = `
# detach policy from multiple environment:
kosli detach-policy yourPolicyName \
Expand All @@ -32,7 +34,6 @@
Short: detachPolicyShortDesc,
Long: detachPolicyShortDesc,
Example: detachPolicyExample,
Hidden: true,
Args: cobra.ExactArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
err := RequireGlobalFlags(global, []string{"Org", "ApiToken"})
Expand Down
9 changes: 4 additions & 5 deletions cmd/kosli/getPolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ type getPolicyOptions struct {
func newGetPolicyCmd(out io.Writer) *cobra.Command {
o := new(getPolicyOptions)
cmd := &cobra.Command{
Use: "policy POLICY-NAME",
Short: getPolicyDesc,
Long: getPolicyDesc,
Args: cobra.ExactArgs(1),
Hidden: true,
Use: "policy POLICY-NAME",
Short: getPolicyDesc,
Long: getPolicyDesc,
Args: cobra.ExactArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
err := RequireGlobalFlags(global, []string{"Org", "ApiToken"})
if err != nil {
Expand Down
9 changes: 4 additions & 5 deletions cmd/kosli/listPolicies.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ type policiesLsOptions struct {
func newListPoliciesCmd(out io.Writer) *cobra.Command {
o := new(policiesLsOptions)
cmd := &cobra.Command{
Use: "policies",
Short: listPoliciesDesc,
Long: listPoliciesDesc,
Args: cobra.NoArgs,
Hidden: true,
Use: "policies",
Short: listPoliciesDesc,
Long: listPoliciesDesc,
Args: cobra.NoArgs,
PreRunE: func(cmd *cobra.Command, args []string) error {
err := RequireGlobalFlags(global, []string{"Org", "ApiToken"})
if err != nil {
Expand Down
Loading