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

Implement human readable output for kn route describe #643

Merged
merged 4 commits into from
Feb 10, 2020

Conversation

navidshaikh
Copy link
Collaborator

@navidshaikh navidshaikh commented Feb 7, 2020

/lint

Fixes #205

Proposed Changes

  • Keeps the machine readable output
  • Align the command description text, check for single argument, reported error messages and unit tests in service, revision, route, source binding describe commands

Default output:

➜  client git:(pr/describe-route) ./kn route describe foo
Name:       foo
Namespace:  default
Age:        2m
URL:        http://foo.default.apps.ci-ln-dr6jjit-d5d6b.origin-ci-int-aws.dev.rhcloud.com
Service:    foo

Traffic Targets:  
   40%  foo-zxjzw-1 #v1
        URL:  http://v1-foo.default.apps.ci-ln-dr6jjit-d5d6b.origin-ci-int-aws.dev.rhcloud.com
   60%  foo-bhjrx-2 #v2
        URL:  http://v2-foo.default.apps.ci-ln-dr6jjit-d5d6b.origin-ci-int-aws.dev.rhcloud.com

Conditions:  
  OK TYPE                  AGE REASON
  ++ Ready                 13s 
  ++ AllTrafficAssigned     2m 
  ++ IngressReady          13s 

Verbose output:

➜  client git:(pr/describe-route) ./kn route describe svc -v
Name:         svc
Namespace:    default
Labels:       serving.knative.dev/service=svc
Annotations:  serving.knative.dev/creator=kube:admin
              serving.knative.dev/lastModifier=kube:admin
Age:          11m
URL:          http://svc.default.apps.ci-ln-dr6jjit-d5d6b.origin-ci-int-aws.dev.rhcloud.com
Service:      svc (serving.knative.dev/v1alpha1)

Traffic Targets:  
  100%  @latest (svc-fkvpz-1)

Conditions:  
  OK TYPE                  AGE REASON
  ++ Ready                 10m 
  ++ AllTrafficAssigned    10m 
  ++ IngressReady          10m 

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 7, 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.

@navidshaikh: 1 warning.

In response to this:

/lint

Fixes #205

Proposed Changes

  • Keeps the machine readable output
  • Align the command description text
  • Add simple e2e test in basic workflow test

Default output:

➜  client git:(pr/describe-route) ./kn route describe foo
Name:       foo
Namespace:  default
Age:        1d
URL:        http://foo.default.example.com

Owner References:  
 Service:  foo

Traffic Targets:  
  60%  foo-tcvhr-4
  40%  foo-rnlnj-3 #v3
       URL:  http://v3-foo.default.example.com

Conditions:  
 OK TYPE                  AGE REASON
 ++ Ready                  1d 
 ++ AllTrafficAssigned     1d 
 ++ IngressReady           1d 

Verbose output:

➜  client git:(pr/describe-route) ./kn route describe svc -v  
Name:         svc
Namespace:    default
Labels:       serving.knative.dev/service=svc
Annotations:  serving.knative.dev/creator=minikube-user
             serving.knative.dev/lastModifier=minikube-user
Age:          1d
URL:          http://svc.default.example.com

Owner References:  
 Service:  svc (serving.knative.dev/v1alpha1)

Traffic Targets:  
 100%  @latest (svc-qxdyq-5)

Conditions:  
 OK TYPE                  AGE REASON
 ++ Ready                  1d 
 ++ AllTrafficAssigned     1d 
 ++ IngressReady           1d 

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/route/describe.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 7, 2020
@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: 0 warnings.

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.

@rhuss
Copy link
Contributor

rhuss commented Feb 7, 2020

@navidshaikh there's a compile error:

# knative.dev/client/test/e2e [knative.dev/client/test/e2e.test]
test/e2e/route_test.go:79:22: (*e2eTest).routeDescribe redeclared in this block
	previous declaration at test/e2e/basic_workflow_test.go:148:6

@rhuss
Copy link
Contributor

rhuss commented Feb 7, 2020

The flaky test should be fixed with #644

@rhuss
Copy link
Contributor

rhuss commented Feb 7, 2020

/retest

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.

looks good (as always ;-) but I would not output an owner reference in general: Print out a service if attached or nothing (see inline).

Otherwise, some minor nits.

docs/cmd/kn_revision_describe.md Outdated Show resolved Hide resolved
pkg/kn/commands/route/describe.go Outdated Show resolved Hide resolved
pkg/kn/commands/route/describe.go Outdated Show resolved Hide resolved
pkg/kn/commands/source/binding/describe.go Outdated Show resolved Hide resolved
@rhuss
Copy link
Contributor

rhuss commented Feb 7, 2020

/retest

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.

LGTM

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maximilien, 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:
  • OWNERS [maximilien,navidshaikh]

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

 - Keeps the machine readable output
 - Align the command description text, check for single argument, reported error messages and unit tests in service, revision, route, source binding describe commands
@navidshaikh navidshaikh force-pushed the pr/describe-route branch 2 times, most recently from 20e77bf to 3bf2396 Compare February 10, 2020 05:48
@rhuss
Copy link
Contributor

rhuss commented Feb 10, 2020

/retest

@navidshaikh
Copy link
Collaborator Author

/retest

boskos

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.

looks good to me with a minor question whether to alway sprint a "Service"

@rhuss
Copy link
Contributor

rhuss commented Feb 10, 2020

/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/route/describe.go 78.3% 89.5% 11.2
pkg/kn/commands/service/describe.go 80.0% 79.8% -0.2

@navidshaikh
Copy link
Collaborator Author

/retest

1 similar comment
@rhuss
Copy link
Contributor

rhuss commented Feb 10, 2020

/retest

@rhuss
Copy link
Contributor

rhuss commented Feb 10, 2020

thanks !

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2020
@knative-prow-robot knative-prow-robot merged commit 15dec58 into knative:master Feb 10, 2020
@navidshaikh navidshaikh deleted the pr/describe-route branch February 10, 2020 18:13
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/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.

Implement kn route describe command
6 participants