-
Notifications
You must be signed in to change notification settings - Fork 70
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
[CLI] Support passing of Service Account to tkn-results #575
Conversation
/kind feature |
@enarha @avinal @sayan-biswas @adambkaplan Can you review this asap? Part of milestone v0.8.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/test pull-tekton-results-integration-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if I provide argument, it is not working for me. I hope I am doing it right.
My results.yaml
address: localhost:8080
token:
ssl:
roots_file_path: /tmp/results.crt
server_name_override: tekton-results-api-service.tekton-pipelines.svc.cluster.local
service_account:
namespace:
name:
$ ./tkn-results list default --sa=tekton-results-debug --sa-ns=tekton-pipelines
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x15e0232]
goroutine 1 [running]:
github.com/tektoncd/results/tools/tkn-results/internal/client.NewDefaultFactory()
/home/avinal/Documents/redhat/github.com/tektoncd/results/tools/tkn-results/internal/client/client.go:38 +0xd2
github.com/tektoncd/results/tools/tkn-results/internal/client.DefaultClient({0x1c34770, 0xc000048120}, {0x0, 0x0})
/home/avinal/Documents/redhat/github.com/tektoncd/results/tools/tkn-results/internal/client/client.go:91 +0x2d
github.com/tektoncd/results/tools/tkn-results/cmd.Root.func1(0xc000004c00?, {0xc000025e00?, 0x3?, 0x3?})
/home/avinal/Documents/redhat/github.com/tektoncd/results/tools/tkn-results/cmd/root.go:54 +0x165
github.com/spf13/cobra.(*Command).execute(0xc000004c00, {0xc000025da0, 0x3, 0x3})
/home/avinal/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:891 +0x739
github.com/spf13/cobra.(*Command).ExecuteC(0xc000004900)
/home/avinal/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/home/avinal/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(0x0?, {0x1c34770?, 0xc000048120?})
/home/avinal/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:961 +0x4a
main.main()
/home/avinal/Documents/redhat/github.com/tektoncd/results/tools/tkn-results/main.go:9 +0x2c
9414457
to
e8374ed
Compare
All flags seem to be broken in the main. |
5348e2d
to
390c6a1
Compare
@avinal Can you test this pr now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, working as expected. I do think that the error messages can be improved. Currently we get this error if nothing is passed or added in the config.
ListRecords: rpc error: code = Unauthenticated desc = permission denied
Error: rpc error: code = Unauthenticated desc = permission denied
We can instead return a more helpful message quoting the possible reasons. Fo now this PR is good.
@enarha @sayan-biswas Let's merge this pr also. @avinal Tested this. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avinal, 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 |
User can pass flag --sa for serviceaccount name and --sa-ns for serviceaccount namespace. Latter is optional. If not given, then namespace from current context is assumed.
/lgtm |
The User can pass the flag
--sa
for serviceaccount name and--sa-ns
for serviceaccount namespace. Latter is optional. If not given, then the namespace from the current context is assumed.Fixes #576
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you review them:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes