Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit ef39066

Browse files
remove the unused attributes from CliOptions in the watch command (#337)
Signed-off-by: Nikhil Sharma <nikhilsharma230303@gmail.com>
1 parent 12c8813 commit ef39066

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

cmd/watch/watch.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ import (
3838

3939
type CliOptions struct {
4040
Config *config.Config
41-
42-
EventTypes string
43-
Source string
4441
}
4542

4643
type brokerLog struct {
@@ -67,7 +64,6 @@ func NewCmd(config *config.Config) *cobra.Command {
6764
return o.watch()
6865
},
6966
}
70-
watchCmd.Flags().StringVarP(&o.EventTypes, "eventTypes", "e", "", "Filter events based on type attribute")
7167
return watchCmd
7268
}
7369

@@ -92,7 +88,7 @@ func (o *CliOptions) watch() error {
9288
if err != nil {
9389
return fmt.Errorf("create container: %w", err)
9490
}
95-
if err := w.CreateTrigger(strings.Split(o.EventTypes, ",")); err != nil {
91+
if err := w.CreateTrigger(); err != nil {
9692
return fmt.Errorf("create trigger: %w", err)
9793
}
9894
brokerLogs, err := w.BrokerLogs(ctx, o.Config.Triggermesh.Broker)

docs/tmctl_watch.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ tmctl watch
1515
### Options
1616

1717
```
18-
-e, --eventTypes string Filter events based on type attribute
19-
-h, --help help for watch
18+
-h, --help help for watch
2019
```
2120

2221
### Options inherited from parent commands

pkg/wiretap/wiretap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (w *Wiretap) CreateAdapter(ctx context.Context) (io.ReadCloser, error) {
8282
return c.Logs(ctx, w.client, time.Now().Add(2*time.Second), true)
8383
}
8484

85-
func (w *Wiretap) CreateTrigger(eventTypes []string) error {
85+
func (w *Wiretap) CreateTrigger() error {
8686
url, err := apis.ParseURL(w.Destination)
8787
if err != nil {
8888
return fmt.Errorf("wiretap URL: %w", err)

0 commit comments

Comments
 (0)