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 kube client oidc authentication support for testing #1577

Merged
merged 1 commit into from
Nov 15, 2019
Merged

Add kube client oidc authentication support for testing #1577

merged 1 commit into from
Nov 15, 2019

Conversation

zhangtbj
Copy link
Contributor

Changes

Currently, the test client in Tekton test doesn't support Kubernetes cluster with oidc authentication.
I tried to run e2e test for my Tekton build, and I found the test can only use the kubeconfig which in ~/.kube/config, and my kube cluster use oidc for auth but the current Tekton client doesn't support that.

I take a look the knative serving and eventing, their clients have the config for oidc:
https://github.com/knative/serving/blob/78995f561c50acb87c9f5d386e07dbb3c597aeeb/test/clients.go#L25

But tekton test client doesn't have that:
https://github.com/tektoncd/pipeline/blob/master/test/clients.go

Without this oidc package,all tests will fail like:

--- FAIL: TestEventListenerCreate (0.00s)
    eventlistener_test.go:48: Failed to create kubernetes clientset from config file at /home/travis/.kube/config: No Auth Provider found for name "oidc"

So I follow what knative repo did in this PR:
1, Use dep to add oidc package:
dep ensure -add k8s.io/client-go/plugin/pkg/client/auth/oidc

2, Add import in test/init_test.go

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Nov 15, 2019
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 15, 2019
@tekton-robot
Copy link
Collaborator

Hi @zhangtbj. Thanks for your PR.

I'm waiting for a tektoncd 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.

@zhangtbj
Copy link
Contributor Author

Hi @vdemeester ,

Pls review by using this one. Thanks!

@vdemeester
Copy link
Member

/ok-to-test

@tekton-robot tekton-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 Nov 15, 2019
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm
Thanks @zhangtbj

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2019
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 15, 2019
@tekton-robot tekton-robot merged commit e42af1b into tektoncd:master Nov 15, 2019
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 Trying to make the CLA bot happy with ppl from different companies work on one commit 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.

None yet

4 participants