Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added eventtype support #1598

Merged
merged 17 commits into from
Mar 2, 2022
Merged

Conversation

vyasgun
Copy link
Contributor

@vyasgun vyasgun commented Feb 2, 2022

Description

Add eventtype support in kn

gvyas-mac:client gvyas$ ./kn eventtype create helloet -t example-type --source example.source.com --broker default
Eventtype 'helloet' successfully created in namespace 'default'.
gvyas-mac:client gvyas$ ./kn eventtype create helloet -t example-type --source example.source.com --broker default
Error: cannot create eventtype 'helloet' in namespace 'default' because: eventtypes.eventing.knative.dev "helloet" already exists
Run 'kn --help' for usage
gvyas-mac:client gvyas$ ./kn eventtype delete helloet
Eventtype 'helloet' successfully deleted in namespace 'default'.
gvyas-mac:client gvyas$ ./kn eventtype list 
NAME                                   TYPE                             SOURCE                                BROKER    SCHEMA   AGE   CONDITIONS   READY   REASON
dev.knative.source.github.push-34cnb   dev.knative.source.github.push   https://github.com/knative/eventing   default            92m   0 OK / 3     False   BrokerDoesNotExist : Broker does not exist
gvyas-mac:client gvyas$ ./kn eventtype describe dev.knative.source.github.push-34cnb
Name:         dev.knative.source.github.push-34cnb
Namespace:    default
Labels:       eventing.knative.dev/sourceName=github-sample
Annotations:  eventing.knative.dev/creator=minikube-user, eventing.knative.dev/lastModifier=minik ...
Age:          23h


Conditions:  
  OK TYPE            AGE REASON
  !! Ready           23h BrokerDoesNotExist
  !! BrokerExists    23h BrokerDoesNotExist
  ?? BrokerReady     23h 

Changes

  • Added EventingV1Beta1 client to kn params
  • Added list subcommand
  • Added describe subcommand
  • Added builder for eventtype
  • Added create subcommand
  • Added delete subcommand
  • Added mock client
  • Added unit tests

Reference

Fixes #1478

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 2, 2022
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@vyasgun: 0 warnings.

In response to this:

Description

Add eventtype support in kn

gvyas-mac:client gvyas$ ./kn eventtype list 
NAME                                   TYPE                             SOURCE                                BROKER    SCHEMA   AGE   CONDITIONS   READY   REASON
dev.knative.source.github.push-34cnb   dev.knative.source.github.push   https://github.com/knative/eventing   default            92m   0 OK / 3     False   BrokerDoesNotExist : Broker does not exist

Changes

  • Added EventingV1Beta1 client to kn params
  • Added list subcommand

Reference

Fixes #1478

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 2, 2022
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 2, 2022
@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Merging #1598 (52e4245) into main (af05208) will increase coverage by 0.15%.
The diff coverage is 85.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1598      +/-   ##
==========================================
+ Coverage   79.80%   79.96%   +0.15%     
==========================================
  Files         163      171       +8     
  Lines        8824     9089     +265     
==========================================
+ Hits         7042     7268     +226     
- Misses       1089     1109      +20     
- Partials      693      712      +19     
Impacted Files Coverage Δ
pkg/kn/commands/types.go 87.36% <71.42%> (-1.27%) ⬇️
pkg/kn/commands/eventtype/describe.go 80.95% <80.95%> (ø)
pkg/kn/commands/eventtype/list.go 82.14% <82.14%> (ø)
pkg/kn/commands/eventtype/delete.go 82.60% <82.60%> (ø)
pkg/eventing/v1beta1/client.go 84.00% <84.00%> (ø)
pkg/kn/commands/completion_helper.go 86.47% <87.50%> (+0.07%) ⬆️
pkg/kn/commands/eventtype/create.go 88.88% <88.88%> (ø)
pkg/eventing/v1beta1/client_mock.go 95.23% <95.23%> (ø)
pkg/kn/commands/eventtype/eventtype.go 100.00% <100.00%> (ø)
pkg/kn/commands/flags/eventtype.go 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af05208...52e4245. Read the comment docs.

@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 15, 2022
@vyasgun vyasgun force-pushed the pr/eventtype branch 2 times, most recently from 5301286 to 5de764b Compare February 17, 2022 09:06
@vyasgun vyasgun changed the title [WIP] Added eventtype support Added eventtype support Feb 18, 2022
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 18, 2022
@vyasgun
Copy link
Contributor Author

vyasgun commented Feb 18, 2022

/retest

2 similar comments
@vyasgun
Copy link
Contributor Author

vyasgun commented Feb 21, 2022

/retest

@vyasgun
Copy link
Contributor Author

vyasgun commented Feb 21, 2022

/retest

@rhuss
Copy link
Contributor

rhuss commented Feb 22, 2022

@vyasgun thanks a lot for the PR ! Unfortunately I'm super busy this week and on PTO next week. @dsimansk @navidshaikh any chance that you could have a review on this PR ?

Copy link
Contributor

@dsimansk dsimansk left a comment

Choose a reason for hiding this comment

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

@vyasgun overall the PR looks great. I've add concerns about the width of list output, but otherwise I haven't noticed anything major.

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/eventing/v1beta1/client.go Do not exist 91.1%
pkg/eventing/v1beta1/client_mock.go Do not exist 94.7%
pkg/kn/commands/completion_helper.go 92.9% 92.9% 0.1
pkg/kn/commands/eventtype/create.go Do not exist 92.3%
pkg/kn/commands/eventtype/delete.go Do not exist 88.2%
pkg/kn/commands/eventtype/describe.go Do not exist 89.5%
pkg/kn/commands/eventtype/eventtype.go Do not exist 100.0%
pkg/kn/commands/eventtype/list.go Do not exist 88.9%
pkg/kn/commands/flags/eventtype.go Do not exist 100.0%
pkg/kn/commands/types.go 94.2% 93.5% -0.6

Copy link
Contributor

@dsimansk dsimansk left a comment

Choose a reason for hiding this comment

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

Thanks!

/approve
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 2, 2022
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, vyasgun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 2, 2022
@knative-prow-robot knative-prow-robot merged commit ad863f3 into knative:main Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kn support for eventtype registry
5 participants