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

kn source list-types (builtin types) #536

Merged
merged 19 commits into from
Dec 10, 2019

Conversation

navidshaikh
Copy link
Collaborator

Part of #511

/lint

Proposed Changes

  • Only lists the builtin source types
  • Uses client-go dynamic client for listing CRDs
  • Adds DyanmicClient interface to KnParams
  • Adds printing options
Example:

Command:

kn source list-types
TYPE              NAME                                            DESCRIPTION
ApiServerSource   apiserversources.sources.eventing.knative.dev   Kubernetes API Server events source
ContainerSource   containersources.sources.eventing.knative.dev   Container events source
CronJobSource     cronjobsources.sources.eventing.knative.dev     CronJob events source

Print flags:

./kn source list-types --help    
List available source types

Usage:
  kn source list-types [flags]

Flags:
      --allow-missing-template-keys   If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
                                      (default true)
  -h, --help                          help for list-types
  -n, --namespace string              Specify the namespace to operate in.
      --no-headers                    When using the default output format, don't print headers (default: print headers).
  -o, --output string                 Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.
      --template string               Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates
                                      [http://golang.org/pkg/text/template/#pkg-overview].

Global Flags:
      --config string       kn config file (default is $HOME/.kn/config.yaml)
      --kubeconfig string   kubectl config file (default is $HOME/.kube/config)
      --log-http            log http traffic

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

In response to this:

Part of #511

/lint

Proposed Changes

  • Only lists the builtin source types
  • Uses client-go dynamic client for listing CRDs
  • Adds DyanmicClient interface to KnParams
  • Adds printing options
Example:

Command:

kn source list-types
TYPE              NAME                                            DESCRIPTION
ApiServerSource   apiserversources.sources.eventing.knative.dev   Kubernetes API Server events source
ContainerSource   containersources.sources.eventing.knative.dev   Container events source
CronJobSource     cronjobsources.sources.eventing.knative.dev     CronJob events source

Print flags:

./kn source list-types --help    
List available source types

Usage:
 kn source list-types [flags]

Flags:
     --allow-missing-template-keys   If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
                                     (default true)
 -h, --help                          help for list-types
 -n, --namespace string              Specify the namespace to operate in.
     --no-headers                    When using the default output format, don't print headers (default: print headers).
 -o, --output string                 Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.
     --template string               Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates
                                     [http://golang.org/pkg/text/template/#pkg-overview].

Global Flags:
     --config string       kn config file (default is $HOME/.kn/config.yaml)
     --kubeconfig string   kubectl config file (default is $HOME/.kube/config)
     --log-http            log http traffic

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/list_types.go Show resolved Hide resolved
pkg/kn/commands/source/human_readable_flags.go Outdated Show resolved Hide resolved
pkg/kn/commands/source/list_types_flags.go Outdated Show resolved Hide resolved
pkg/kn/commands/source/source.go Show resolved Hide resolved
pkg/dynamic/client.go Outdated Show resolved Hide resolved
pkg/dynamic/client.go Outdated Show resolved Hide resolved
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 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 6, 2019
@navidshaikh navidshaikh force-pushed the pr/list-types branch 2 times, most recently from ba215b8 to 52c2311 Compare December 9, 2019 11:37
@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 9, 2019
@navidshaikh navidshaikh changed the title [WIP]feat: kn source list-types (builtin types) kn source list-types (builtin types) Dec 10, 2019
@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 Dec 10, 2019
@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: 2 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.

pkg/kn/commands/source/source.go Outdated Show resolved Hide resolved
pkg/kn/commands/testing_helper.go Show resolved Hide resolved
@navidshaikh
Copy link
Collaborator Author

/test pull-knative-client-integration-tests

boskos

 - Only lists the builtin source types
 - Uses client-go dynamic client for listing CRDs
 - Adds DyanmicClient interface to KnParams
 - Adds printing options
 GVR as:
   - Group: apiextensions.k8s.io
   - Version: v1beta1
   - Resource: customresourcedefinitions
 Label as:
   {"duck.knative.dev/source": "true"}
  as - "Binding Pattern for ContainerSource"
@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/dynamic/client.go Do not exist 90.9%
pkg/kn/commands/source/human_readable_flags.go Do not exist 87.0%
pkg/kn/commands/source/list_types.go Do not exist 70.8%
pkg/kn/commands/source/list_types_flags.go Do not exist 66.7%
pkg/kn/commands/source/source.go Do not exist 100.0%
pkg/kn/commands/testing_helper.go 58.8% 64.4% 5.6
pkg/kn/commands/types.go 61.4% 62.2% 0.9

@sixolet
Copy link
Contributor

sixolet commented Dec 10, 2019

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 10, 2019
@knative-prow-robot knative-prow-robot merged commit 7dbb5a5 into knative:master Dec 10, 2019
@navidshaikh navidshaikh deleted the pr/list-types branch December 18, 2019 11:09
coryrc pushed a commit to coryrc/client that referenced this pull request May 14, 2020
* Make all github calls as receivable by github client

* Remove client and user vars as they are handled in ghIssue

* Rename to NewGithubclient as we are creating a new client
dsimansk added a commit to dsimansk/client that referenced this pull request Dec 6, 2024
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.

5 participants