Skip to content

Commit

Permalink
refactor(topics): validate user session earlier (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enda authored Jan 14, 2021
1 parent c5d4c3f commit 49a6a66
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cmd/kafka/topics/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func NewCreateTopicCommand(f *factory.Factory) *cobra.Command {
}

func createTopic(opts *Options) error {
_, err := opts.Connection()
if err != nil {
return err
}

logger, err := opts.Logger()
if err != nil {
return err
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/kafka/topics/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func NewDeleteTopicCommand(f *factory.Factory) *cobra.Command {
}

func deleteTopic(opts *Options) error {
_, err := opts.Connection()
if err != nil {
return err
}

logger, err := opts.Logger()
if err != nil {
return err
Expand Down
5 changes: 5 additions & 0 deletions pkg/cmd/kafka/topics/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func NewListTopicCommand(f *factory.Factory) *cobra.Command {
}

func listTopic(opts *Options) error {
_, err := opts.Connection()
if err != nil {
return err
}

logger, err := opts.Logger()
if err != nil {
return err
Expand Down

0 comments on commit 49a6a66

Please sign in to comment.