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

Add ApiServer source update and describe commands #556

Merged
merged 16 commits into from
Dec 16, 2019

Conversation

navidshaikh
Copy link
Collaborator

@navidshaikh navidshaikh commented Dec 15, 2019

Proposed Changes

  • Add kn source apiserver update and kn source apiserver describe
  • Dont return created ApiServer source object but only error
  • Align creating ApiServer source client, removes unit tests
  • Add ApiServer source update command
  • Rename TestMockKnClient to TestMockKnCronJobSourceClient
  • Add mock client for ApiServer Source and its tests
  • Add mock unit tests for create, delete and update
  • Add e2e tests for ApiServer source update
    • Add a test for ApiServer source sink update
    • Verify the updated sink name after the ApiServer source is updated
    • Update resource names in existing tests
  • Use builder pattern to generate ApiServer source

/lint

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Dec 15, 2019
@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 15, 2019
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.

@navidshaikh: 23 warnings.

In response to this:

Proposed Changes

  • Dont return created ApiServer source object but only error,
  • Align creating ApiServer source client, removes unit tests
  • Add ApiServer source update command
  • Rename TestMockKnClient to TestMockKnCronJobSourceClient
  • Add mock client for ApiServer Source and its tests
  • Add mock unit tests for create, delete and update
  • Add e2e tests for apiserver source update
  • Add a test for apiserver source sink update
  • Verify the updated sink name after the apiserver source is created
  • Update resource names in existing tests

TODO:

  • better unit tests coverage
  • more e2e tests

/lint

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.

pkg/kn/commands/source/apiserver/apiserver.go Outdated Show resolved Hide resolved
pkg/kn/commands/source/apiserver/apiserver_test.go Outdated Show resolved Hide resolved
pkg/kn/commands/source/apiserver/apiserver_test.go Outdated Show resolved Hide resolved
pkg/kn/commands/source/apiserver/apiserver_test.go Outdated Show resolved Hide resolved
pkg/eventing/sources/v1alpha1/apiserver_client_mock.go Outdated Show resolved Hide resolved
pkg/eventing/sources/v1alpha1/apiserver_client_mock.go Outdated Show resolved Hide resolved
pkg/eventing/sources/v1alpha1/apiserver_client_mock.go Outdated Show resolved Hide resolved
pkg/eventing/sources/v1alpha1/apiserver_client_mock.go Outdated Show resolved Hide resolved
pkg/eventing/sources/v1alpha1/apiserver_client.go Outdated Show resolved Hide resolved
pkg/eventing/sources/v1alpha1/apiserver_client.go Outdated Show resolved Hide resolved
@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 Dec 16, 2019
Copy link
Member

@daisy-ycguo daisy-ycguo left a comment

Choose a reason for hiding this comment

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

lgtm. Thank you for the improvement to apiserver.

@navidshaikh
Copy link
Collaborator Author

/lint

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.

@navidshaikh: 1 warning.

In response to this:

/lint

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.

test/e2e/source_apiserver_test.go Outdated Show resolved Hide resolved
 - Add command and unit tests
 - TODO for later: Add 'Controller Selector' section for --verbose
@navidshaikh navidshaikh changed the title Add ApiServer source update command Add ApiServer source update and describe command Dec 16, 2019
@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/sources/v1alpha1/apiserver_client.go 62.5% 100.0% 37.5
pkg/eventing/sources/v1alpha1/apiserver_client_mock.go Do not exist 89.5%
pkg/kn/commands/source/apiserver/apiserver.go 100.0% 57.1% -42.9
pkg/kn/commands/source/apiserver/create.go 81.2% 85.2% 3.9
pkg/kn/commands/source/apiserver/delete.go 76.5% 82.4% 5.9
pkg/kn/commands/source/apiserver/describe.go Do not exist 84.3%
pkg/kn/commands/source/apiserver/flags.go Do not exist 95.2%
pkg/kn/commands/source/apiserver/update.go Do not exist 78.9%

@navidshaikh navidshaikh changed the title Add ApiServer source update and describe command Add ApiServer source update and describe commands Dec 16, 2019
Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

thanks, looks very good ! Love the appreciation of the details (like naming it APIServerSource)

Let's get that merged and ready for tomorrow.

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: navidshaikh, rhuss

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 merged commit 6ac25cd into knative:master Dec 16, 2019
@navidshaikh navidshaikh deleted the pr/apiserver-update branch December 16, 2019 19:25
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. cla: yes Indicates the PR's author has signed the CLA. 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.

6 participants