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

Fix service/revision list output with '-o' param #1276

Merged

Conversation

evidolob
Copy link
Contributor

Description

This PR fixes behaviour of service list -o <format> and revision list -o <format> command in case when there are no services/revisions:

$ ./kn service list -o json
{
    "apiVersion": "serving.knative.dev/v1",
    "items": [],
    "kind": "ServiceList"
}

Changes

  • revision/list.go now checks -o option before type No revisions found.
  • service/list.go now checks -o option before type No services found.

Reference

Fixes #1273

@google-cla
Copy link

google-cla bot commented Mar 31, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no Indicates the PR's author has not signed the CLA. label Mar 31, 2021
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.

@evidolob: 0 warnings.

In response to this:

Description

This PR fixes behaviour of service list -o <format> and revision list -o <format> command in case when there are no services/revisions:

$ ./kn service list -o json
{
   "apiVersion": "serving.knative.dev/v1",
   "items": [],
   "kind": "ServiceList"
}

Changes

  • revision/list.go now checks -o option before type No revisions found.
  • service/list.go now checks -o option before type No services found.

Reference

Fixes #1273

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
Copy link
Contributor

Welcome @evidolob! It looks like this is your first PR to knative/client 🎉

@knative-prow-robot
Copy link
Contributor

Hi @evidolob. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 31, 2021
@dsimansk
Copy link
Contributor

Thanks!
/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 31, 2021
Signed-off-by: Yevhen Vydolob <[email protected]>
Signed-off-by: Yevhen Vydolob <[email protected]>
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 31, 2021
@google-cla
Copy link

google-cla bot commented Mar 31, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@dsimansk
Copy link
Contributor

This fix covers service list and revision list, but there's a few more list subcommands that has exactly the same handling of empty lists.

@rhuss @navidshaikh should we tackle it at once? Or creating another issue would be sufficient?

…-revision-list

� Conflicts:
�	CHANGELOG.adoc
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 31, 2021
@google-cla
Copy link

google-cla bot commented Mar 31, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

Copy link
Contributor

@maximilien maximilien left a comment

Choose a reason for hiding this comment

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

/ok-to-test
/approve

Thanks for the contribution

@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 31, 2021
@maximilien
Copy link
Contributor

@evidolob you might need to sign the CLA... see @google-cla bot message above

@evidolob
Copy link
Contributor Author

evidolob commented Apr 1, 2021

@googlebot I signed it!

@google-cla google-cla bot added cla: yes Indicates the PR's author has signed the CLA. and removed cla: no Indicates the PR's author has not signed the CLA. labels Apr 1, 2021
@evidolob
Copy link
Contributor Author

evidolob commented Apr 1, 2021

@dsimansk I can handle all list commands in this PR

@dsimansk
Copy link
Contributor

dsimansk commented Apr 1, 2021

@dsimansk I can handle all list commands in this PR

If you don't mind the extra work, please go ahead. IMO it'd be better to align the listing output for every command.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 1, 2021
@evidolob
Copy link
Contributor Author

evidolob commented Apr 6, 2021

/retest

2 similar comments
@rhuss
Copy link
Contributor

rhuss commented Apr 6, 2021

/retest

@rhuss
Copy link
Contributor

rhuss commented Apr 6, 2021

/retest

@rhuss
Copy link
Contributor

rhuss commented Apr 6, 2021

The tests are currently failing, so we can't include this PR for 0.22. However as this is a fix, we can quickly release a 0.22.1 afterwards when the e2e test issue is fixed.

@rhuss
Copy link
Contributor

rhuss commented Apr 6, 2021

/hold

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 6, 2021
Signed-off-by: Yevhen Vydolob <[email protected]>
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2021
@evidolob
Copy link
Contributor Author

evidolob commented Apr 7, 2021

/retest

1 similar comment
@evidolob
Copy link
Contributor Author

evidolob commented Apr 7, 2021

/retest

…-revision-list

� Conflicts:
�	CHANGELOG.adoc
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2021
Signed-off-by: Yevhen Vydolob <[email protected]>
@evidolob
Copy link
Contributor Author

evidolob commented Apr 8, 2021

/retest

1 similar comment
@evidolob
Copy link
Contributor Author

evidolob commented Apr 9, 2021

/retest

Signed-off-by: Yevhen Vydolob <[email protected]>
@evidolob
Copy link
Contributor Author

evidolob commented Apr 9, 2021

/retest

@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/kn/commands/channel/list_types.go 81.1% 81.0% -0.1
pkg/kn/commands/source/list.go 70.3% 73.2% 2.9
pkg/kn/commands/source/list_types.go 75.7% 76.2% 0.5

@evidolob
Copy link
Contributor Author

/retest

@dsimansk
Copy link
Contributor

@evidolob thanks!

I've gone through the PR and it covers all list commands. Except the newly added domain by me, I'll fix that in a follow-up PR.

/approve
/lgtm
/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 13, 2021
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 13, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [dsimansk,maximilien]

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

@dsimansk dsimansk mentioned this pull request Apr 13, 2021
@knative-prow-robot knative-prow-robot merged commit 563f1d9 into knative:main Apr 13, 2021
@evidolob evidolob deleted the fix-service-and-revision-list branch April 13, 2021 14:54
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List command doesn't return empty result in correct format
6 participants