Skip to content

Commit

Permalink
common way of referring to tekton resources in user facing messages: …
Browse files Browse the repository at this point in the history
…TriggerTemplate
  • Loading branch information
danielhelfand authored and tekton-robot committed Oct 21, 2020
1 parent 20291f9 commit 59872d3
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 43 deletions.
2 changes: 1 addition & 1 deletion docs/cmd/tkn.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ CLI for tekton pipelines
* [tkn task](tkn_task.md) - Manage Tasks
* [tkn taskrun](tkn_taskrun.md) - Manage TaskRuns
* [tkn triggerbinding](tkn_triggerbinding.md) - Manage TriggerBindings
* [tkn triggertemplate](tkn_triggertemplate.md) - Manage triggertemplates
* [tkn triggertemplate](tkn_triggertemplate.md) - Manage TriggerTemplates
* [tkn version](tkn_version.md) - Prints version information

10 changes: 5 additions & 5 deletions docs/cmd/tkn_triggertemplate.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## tkn triggertemplate

Manage triggertemplates
Manage TriggerTemplates

***Aliases**: tt,triggertemplates*

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

### Synopsis

Manage triggertemplates
Manage TriggerTemplates

### Options

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

* [tkn](tkn.md) - CLI for tekton pipelines
* [tkn triggertemplate delete](tkn_triggertemplate_delete.md) - Delete triggertemplates in a namespace
* [tkn triggertemplate describe](tkn_triggertemplate_describe.md) - Describes a triggertemplate in a namespace
* [tkn triggertemplate list](tkn_triggertemplate_list.md) - Lists triggertemplates in a namespace
* [tkn triggertemplate delete](tkn_triggertemplate_delete.md) - Delete TriggerTemplates in a namespace
* [tkn triggertemplate describe](tkn_triggertemplate_describe.md) - Describes a TriggerTemplate in a namespace
* [tkn triggertemplate list](tkn_triggertemplate_list.md) - Lists TriggerTemplates in a namespace

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

Delete triggertemplates in a namespace
Delete TriggerTemplates in a namespace

***Aliases**: rm*

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

### Synopsis

Delete triggertemplates in a namespace
Delete TriggerTemplates in a namespace

### Examples

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

### SEE ALSO

* [tkn triggertemplate](tkn_triggertemplate.md) - Manage triggertemplates
* [tkn triggertemplate](tkn_triggertemplate.md) - Manage TriggerTemplates

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

Describes a triggertemplate in a namespace
Describes a TriggerTemplate in a namespace

***Aliases**: desc*

Expand All @@ -12,7 +12,7 @@ tkn triggertemplate describe

### Synopsis

Describes a triggertemplate in a namespace
Describes a TriggerTemplate in a namespace

### Examples

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

### SEE ALSO

* [tkn triggertemplate](tkn_triggertemplate.md) - Manage triggertemplates
* [tkn triggertemplate](tkn_triggertemplate.md) - Manage TriggerTemplates

8 changes: 4 additions & 4 deletions docs/cmd/tkn_triggertemplate_list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## tkn triggertemplate list

Lists triggertemplates in a namespace
Lists TriggerTemplates in a namespace

***Aliases**: ls*

Expand All @@ -12,11 +12,11 @@ tkn triggertemplate list

### Synopsis

Lists triggertemplates in a namespace
Lists TriggerTemplates in a namespace

### Examples

List all triggertemplates in namespace 'bar':
List all TriggerTemplates in namespace 'bar':

tkn triggertemplate list -n bar

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

### SEE ALSO

* [tkn triggertemplate](tkn_triggertemplate.md) - Manage triggertemplates
* [tkn triggertemplate](tkn_triggertemplate.md) - Manage TriggerTemplates

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

.SH NAME
.PP
tkn\-triggertemplate\-delete \- Delete triggertemplates in a namespace
tkn\-triggertemplate\-delete \- Delete TriggerTemplates in a namespace


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

.SH DESCRIPTION
.PP
Delete triggertemplates in a namespace
Delete TriggerTemplates in a namespace


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

.SH NAME
.PP
tkn\-triggertemplate\-describe \- Describes a triggertemplate in a namespace
tkn\-triggertemplate\-describe \- Describes a TriggerTemplate in a namespace


.SH SYNOPSIS
Expand All @@ -15,7 +15,7 @@ tkn\-triggertemplate\-describe \- Describes a triggertemplate in a namespace

.SH DESCRIPTION
.PP
Describes a triggertemplate in a namespace
Describes a TriggerTemplate in a namespace


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

.SH NAME
.PP
tkn\-triggertemplate\-list \- Lists triggertemplates in a namespace
tkn\-triggertemplate\-list \- Lists TriggerTemplates in a namespace


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

.SH DESCRIPTION
.PP
Lists triggertemplates in a namespace
Lists TriggerTemplates in a namespace


.SH OPTIONS
Expand Down Expand Up @@ -57,7 +57,7 @@ Lists triggertemplates in a namespace

.SH EXAMPLE
.PP
List all triggertemplates in namespace 'bar':
List all TriggerTemplates in namespace 'bar':

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

.SH NAME
.PP
tkn\-triggertemplate \- Manage triggertemplates
tkn\-triggertemplate \- Manage TriggerTemplates


.SH SYNOPSIS
Expand All @@ -15,7 +15,7 @@ tkn\-triggertemplate \- Manage triggertemplates

.SH DESCRIPTION
.PP
Manage triggertemplates
Manage TriggerTemplates


.SH OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/triggertemplate/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 triggertemplates in a namespace",
Short: "Delete TriggerTemplates in a namespace",
Example: eg,
Args: cobra.MinimumNArgs(0),
SilenceUsage: true,
Expand Down
8 changes: 3 additions & 5 deletions pkg/cmd/triggertemplate/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"fmt"
"io"
"os"
"text/tabwriter"
"text/template"

Expand Down Expand Up @@ -81,7 +80,7 @@ or
c := &cobra.Command{
Use: "describe",
Aliases: []string{"desc"},
Short: "Describes a triggertemplate in a namespace",
Short: "Describes a TriggerTemplate in a namespace",
Example: eg,
Annotations: map[string]string{
"commandType": "main",
Expand All @@ -96,8 +95,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)
}

if output != "" {
Expand Down Expand Up @@ -143,7 +141,7 @@ func printTriggerTemplateDescription(s *cli.Stream, p cli.Params, ttname string)

tt, err := cs.Triggers.TriggersV1alpha1().TriggerTemplates(p.Namespace()).Get(context.Background(), ttname, metav1.GetOptions{})
if err != nil {
return fmt.Errorf("failed to get triggertemplate %s from %s namespace: %v", ttname, p.Namespace(), err)
return fmt.Errorf("failed to get TriggerTemplate %s from %s namespace: %v", ttname, p.Namespace(), err)
}

var data = struct {
Expand Down
13 changes: 6 additions & 7 deletions pkg/cmd/triggertemplate/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package triggertemplate

import (
"context"
"errors"
"fmt"
"text/tabwriter"

Expand All @@ -32,13 +31,13 @@ import (
)

const (
emptyMsg = "No triggertemplates found"
emptyMsg = "No TriggerTemplates found"
)

func listCommand(p cli.Params) *cobra.Command {
f := cliopts.NewPrintFlags("list")

eg := `List all triggertemplates in namespace 'bar':
eg := `List all TriggerTemplates in namespace 'bar':
tkn triggertemplate list -n bar
Expand All @@ -50,7 +49,7 @@ or
c := &cobra.Command{
Use: "list",
Aliases: []string{"ls"},
Short: "Lists triggertemplates in a namespace",
Short: "Lists TriggerTemplates in a namespace",
Annotations: map[string]string{
"commandType": "main",
},
Expand All @@ -63,12 +62,12 @@ or

tts, err := list(cs.Triggers, p.Namespace())
if err != nil {
return fmt.Errorf("failed to list triggertemplates from %s namespace: %v", p.Namespace(), err)
return fmt.Errorf("failed to list TriggerTemplates from %s namespace: %v", p.Namespace(), err)
}

output, err := cmd.LocalFlags().GetString("output")
if err != nil {
return errors.New("output option not set properly")
return fmt.Errorf("output option not set properly: %v", err)
}

stream := &cli.Stream{
Expand All @@ -81,7 +80,7 @@ or
}

if err = printFormatted(stream, tts, p); err != nil {
return errors.New("failed to print triggertemplates")
return fmt.Errorf("failed to print TriggerTemplates: %v", err)
}
return nil

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
No triggertemplates found
No TriggerTemplates found
Original file line number Diff line number Diff line change
@@ -1 +1 @@
No triggertemplates found
No TriggerTemplates found
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Error: failed to get triggertemplate bar from invalid namespace: triggertemplates.triggers.tekton.dev "bar" not found
Error: failed to get TriggerTemplate bar from invalid namespace: triggertemplates.triggers.tekton.dev "bar" not found
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Error: failed to get triggertemplate bar from ns namespace: triggertemplates.triggers.tekton.dev "bar" not found
Error: failed to get TriggerTemplate bar from ns namespace: triggertemplates.triggers.tekton.dev "bar" not found
2 changes: 1 addition & 1 deletion pkg/cmd/triggertemplate/triggertemplate.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: "triggertemplate",
Aliases: []string{"tt", "triggertemplates"},
Short: "Manage triggertemplates",
Short: "Manage TriggerTemplates",
Annotations: map[string]string{
"commandType": "main",
},
Expand Down

0 comments on commit 59872d3

Please sign in to comment.