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 machine readable output for trigger #1121

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

arghya88
Copy link
Contributor

Signed-off-by: Arghya Sadhu [email protected]

Description

Changes

*Add machine readable output (-o flag) to kn trigger describe

Reference

Fixes #1095

/lint

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 13, 2020
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.

@arghya88: 0 warnings.

In response to this:

Signed-off-by: Arghya Sadhu [email protected]

Description

Changes

*Add machine readable output (-o flag) to kn trigger describe

Reference

Fixes #1095

/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.

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 13, 2020
@arghya88
Copy link
Contributor Author

@navidshaikh any idea why the test for -o yaml is failing with error

describe_test.go:91: assertion failed: error is not nil: missing apiVersion or kind; try GetObjectKind().SetGroupVersionKind() if you know the type

pkg/kn/commands/trigger/describe.go Outdated Show resolved Hide resolved
@navidshaikh
Copy link
Collaborator

navidshaikh commented Nov 17, 2020

@navidshaikh any idea why the test for -o yaml is failing with error

@arghya88 : The genericclioptions util we use to enable the machine readable output, requires GroupVersionKind set on the object.

You need to update GroupVersionKind of the object you GET via knEventingClient.

For example: here its done for the list object of trigger and each individual items in the list. For GET call you should update GVK for the received object in this method.

here is another example of setting GVK for service object we GET

err = updateServingGvk(service)

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 18, 2020
@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 18, 2020
@arghya88 arghya88 force-pushed the trigger-output branch 2 times, most recently from 3e60bb0 to c66054d Compare November 18, 2020 06:02
Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

Please run ./hack/build.sh and commit

📖 Docs ERROR: Modified files found:  M docs/cmd/kn_trigger_describe.md ERROR: Diff diff --git a/docs/cmd/kn_trigger_describe.md b/docs/cmd/kn_trigger_describe.md index 3884b35b..bdc194a7 100644 --- a/docs/cmd/kn_trigger_describe.md +++ b/docs/cmd/kn_trigger_describe.md @@ -19,9 +19,6 @@ kn trigger describe NAME      # Describe a trigger 'my-trigger' in YAML format    kn trigger describe my-trigger -o yaml - -  # Print only trigger URL -  kn trigger describe my-trigger -o url  ```    ### Options ERROR: /home/prow/go/src/knative.dev/client is out of date. Please run ./hack/build.sh -c and commit.
--

@arghya88 arghya88 force-pushed the trigger-output branch 5 times, most recently from 25812a7 to 0e87ded Compare November 18, 2020 08:44
@arghya88
Copy link
Contributor Author

@navidshaikh tests are passing now.PTAL

@arghya88
Copy link
Contributor Author

/assign @navidshaikh

Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

lgtm, lets fix the typo in CHANGELOG and this should be good to go.

CHANGELOG.adoc Outdated Show resolved Hide resolved
@arghya88
Copy link
Contributor Author

@navidshaikh Changes done.PTAL

Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

@arghya88 : The CI failure needs a fix in eventing nightly setup, see knative/hack#24 I will retest once its merged/fixed. Meanwhile can you please fix the CHANGELOG as suggested below?

CHANGELOG.adoc Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 18, 2020
@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 18, 2020
@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 86.8% 86.2% -0.6
pkg/kn/commands/trigger/describe.go 82.5% 83.3% 0.8

Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

/retest
/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Nov 24, 2020
@knative-prow-robot knative-prow-robot merged commit 0411239 into knative:master Nov 24, 2020
@arghya88 arghya88 deleted the trigger-output branch November 28, 2020 07:18
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add machine readable output (-o flag) to kn trigger describe
5 participants