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
2 changes: 1 addition & 1 deletion docs/cmd/tkn.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CLI for tekton pipelines
* [tkn clustertask](tkn_clustertask.md) - Manage ClusterTasks
* [tkn clustertriggerbinding](tkn_clustertriggerbinding.md) - Manage clustertriggerbindings
* [tkn completion](tkn_completion.md) - Prints shell completion scripts
* [tkn condition](tkn_condition.md) - Manage conditions
* [tkn condition](tkn_condition.md) - Manage Conditions
* [tkn eventlistener](tkn_eventlistener.md) - Manage EventListeners
* [tkn pipeline](tkn_pipeline.md) - Manage pipelines
* [tkn pipelinerun](tkn_pipelinerun.md) - Manage PipelineRuns
Expand Down
8 changes: 4 additions & 4 deletions docs/cmd/tkn_condition.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## tkn condition

Manage conditions
Manage Conditions

***Aliases**: cond,conditions*

Expand All @@ -12,7 +12,7 @@ tkn condition

### Synopsis

Manage conditions
Manage Conditions

### Options

Expand All @@ -27,7 +27,7 @@ Manage conditions
### SEE ALSO

* [tkn](tkn.md) - CLI for tekton pipelines
* [tkn condition delete](tkn_condition_delete.md) - Delete a condition in a namespace
* [tkn condition delete](tkn_condition_delete.md) - Delete Conditions in a namespace
* [tkn condition describe](tkn_condition_describe.md) - Describe Conditions in a namespace
* [tkn condition list](tkn_condition_list.md) - Lists conditions in a namespace
* [tkn condition list](tkn_condition_list.md) - Lists Conditions in a namespace

6 changes: 3 additions & 3 deletions docs/cmd/tkn_condition_delete.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## tkn condition delete

Delete a condition in a namespace
Delete Conditions in a namespace

***Aliases**: rm*

Expand All @@ -12,7 +12,7 @@ tkn condition delete

### Synopsis

Delete a condition in a namespace
Delete Conditions in a namespace

### Examples

Expand Down Expand Up @@ -47,5 +47,5 @@ or

### SEE ALSO

* [tkn condition](tkn_condition.md) - Manage conditions
* [tkn condition](tkn_condition.md) - Manage Conditions

2 changes: 1 addition & 1 deletion docs/cmd/tkn_condition_describe.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ or

### SEE ALSO

* [tkn condition](tkn_condition.md) - Manage conditions
* [tkn condition](tkn_condition.md) - Manage Conditions

6 changes: 3 additions & 3 deletions docs/cmd/tkn_condition_list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## tkn condition list

Lists conditions in a namespace
Lists Conditions in a namespace

***Aliases**: ls*

Expand All @@ -12,7 +12,7 @@ tkn condition list

### Synopsis

Lists conditions in a namespace
Lists Conditions in a namespace

### Options

Expand All @@ -34,5 +34,5 @@ Lists conditions in a namespace

### SEE ALSO

* [tkn condition](tkn_condition.md) - Manage conditions
* [tkn condition](tkn_condition.md) - Manage Conditions

4 changes: 2 additions & 2 deletions docs/man/man1/tkn-condition-delete.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.SH NAME
.PP
tkn\-condition\-delete \- Delete a condition in a namespace
tkn\-condition\-delete \- Delete Conditions in a namespace


.SH SYNOPSIS
Expand All @@ -15,7 +15,7 @@ tkn\-condition\-delete \- Delete a condition in a namespace

.SH DESCRIPTION
.PP
Delete a condition in a namespace
Delete Conditions in a namespace


.SH OPTIONS
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/tkn-condition-list.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.SH NAME
.PP
tkn\-condition\-list \- Lists conditions in a namespace
tkn\-condition\-list \- Lists Conditions in a namespace


.SH SYNOPSIS
Expand All @@ -15,7 +15,7 @@ tkn\-condition\-list \- Lists conditions in a namespace

.SH DESCRIPTION
.PP
Lists conditions in a namespace
Lists Conditions in a namespace


.SH OPTIONS
Expand Down
4 changes: 2 additions & 2 deletions docs/man/man1/tkn-condition.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

.SH NAME
.PP
tkn\-condition \- Manage conditions
tkn\-condition \- Manage Conditions


.SH SYNOPSIS
Expand All @@ -15,7 +15,7 @@ tkn\-condition \- Manage conditions

.SH DESCRIPTION
.PP
Manage conditions
Manage Conditions


.SH OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/condition/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Command(p cli.Params) *cobra.Command {
cmd := &cobra.Command{
Use: "condition",
Aliases: []string{"cond", "conditions"},
Short: "Manage conditions",
Short: "Manage Conditions",
Annotations: map[string]string{
"commandType": "main",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/condition/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ or
c := &cobra.Command{
Use: "delete",
Aliases: []string{"rm"},
Short: "Delete a condition in a namespace",
Short: "Delete Conditions in a namespace",
Example: eg,
Args: cobra.MinimumNArgs(0),
SilenceUsage: true,
Expand Down
6 changes: 2 additions & 4 deletions pkg/cmd/condition/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package condition
import (
"context"
"fmt"
"os"
"text/tabwriter"
"text/template"

Expand Down Expand Up @@ -108,8 +107,7 @@ or

output, err := cmd.LocalFlags().GetString("output")
if err != nil {
fmt.Fprint(os.Stderr, "Error: output option not set properly \n")
return err
return fmt.Errorf("output option not set properly: %v", err)
}

condition, err := getCondition(p, args[0])
Expand Down Expand Up @@ -141,7 +139,7 @@ func getCondition(p cli.Params, name string) (*v1alpha1.Condition, error) {

condition, err := cs.Tekton.TektonV1alpha1().Conditions(p.Namespace()).Get(context.Background(), name, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to find condition %q", name)
return nil, fmt.Errorf("failed to find Condition %q", name)
}

// NOTE: this is required for -o json|yaml to work properly since
Expand Down
11 changes: 4 additions & 7 deletions pkg/cmd/condition/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func listCommand(p cli.Params) *cobra.Command {
c := &cobra.Command{
Use: "list",
Aliases: []string{"ls"},
Short: "Lists conditions in a namespace",
Short: "Lists Conditions in a namespace",
Annotations: map[string]string{
"commandType": "main",
},
Expand All @@ -54,8 +54,7 @@ func listCommand(p cli.Params) *cobra.Command {

output, err := cmd.LocalFlags().GetString("output")
if err != nil {
fmt.Fprint(stream.Err, "Error: output option not set properly \n")
return err
return fmt.Errorf("output option not set properly: %v", err)
}

if output != "" {
Expand All @@ -78,8 +77,7 @@ func printConditionDetails(s *cli.Stream, p cli.Params) error {

conditions, err := listAllConditions(cs.Tekton, p.Namespace())
if err != nil {
fmt.Fprintf(s.Err, "Failed to list conditions from %s namespace \n", p.Namespace())
return err
return fmt.Errorf("failed to list Conditions from %s namespace: %v", p.Namespace(), err)
}

if len(conditions.Items) == 0 {
Expand Down Expand Up @@ -108,8 +106,7 @@ func printConditionListObj(s *cli.Stream, p cli.Params, f *cliopts.PrintFlags) e

conditions, err := listAllConditions(cs.Tekton, p.Namespace())
if err != nil {
fmt.Fprintf(s.Err, "Failed to list conditions from %s namespace \n", p.Namespace())
return err
return fmt.Errorf("failed to list Conditions from %s namespace: %v", p.Namespace(), err)
}
return printer.PrintObject(s.Out, conditions, f)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Error: failed to find condition "invalid"
Error: failed to find Condition "invalid"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Error: failed to find condition "cond-2"
Error: failed to find Condition "cond-2"
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Failed to list conditions from ns namespace
Error: test error
Error: failed to list Conditions from ns namespace: test error
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Failed to list conditions from ns namespace
Error: test error
Error: failed to list Conditions from ns namespace: test error