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

tkn taskrun list is throwing error regarding cluster scope permissions #1874

Closed
piyush-garg opened this issue Jan 31, 2023 · 0 comments · Fixed by #1875
Closed

tkn taskrun list is throwing error regarding cluster scope permissions #1874

piyush-garg opened this issue Jan 31, 2023 · 0 comments · Fixed by #1875
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@piyush-garg
Copy link
Contributor

piyush-garg commented Jan 31, 2023

Versions and Operating System

  • Kubernetes version:

    Output of kubectl version:

    Kubernetes Version: v1.24.6+5157800
    
  • Tekton Pipeline version:

    Output of tkn version or kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

    tkn version                                                       
    Client version: 0.29.0
    Pipeline version: v0.33.2
    Triggers version: v0.19.0
    Operator version: v0.55.1
    
  • Operating System:

    Fedora 36
    

Expected Behavior

tkn taskrun list command should work fine and show the list of taskruns

Actual Behavior

tkn taskrun list command throwing error

Error: failed to list TaskRuns from namespace test-list: taskruns.tekton.dev is forbidden: User "user1" cannot list resource "taskruns" in API group "tekton.dev" at the cluster scope

Steps to Reproduce the Problem

  1. Login to any cluster as a normal user who have access to limited namespaces and have pipeline installed
  2. Hit command tkn tr ls
  3. See the error

Additional Info

It is working fine with tkn 0.28.0

@piyush-garg piyush-garg added the kind/bug Categorizes issue or PR as related to a bug. label Jan 31, 2023
@piyush-garg piyush-garg added this to the 0.30.0 milestone Jan 31, 2023
@piyush-garg piyush-garg self-assigned this Jan 31, 2023
piyush-garg added a commit to piyush-garg/cli that referenced this issue Jan 31, 2023
This will fix the issue for taskrun list command
not working and throwing error regarding cluster-scope
as the client is not getting initialized before and namespace
is empty if not passed specifically.

The client initialization happening in every cmd init was removed
because not required for all cmds.

This revert thats and add exception for bundle cmds based on
annotation available on cmd

Fix tektoncd#1874
piyush-garg added a commit to piyush-garg/cli that referenced this issue Feb 1, 2023
This will fix the issue for taskrun list command
not working and throwing error regarding cluster-scope
as the client is not getting initialized before and namespace
is empty if not passed specifically.

The client initialization happening in every cmd init was removed
because it was getting initialized in all cmds but not required in
cmd like bundle and hence bundle cmd failing with kube config error
which was not required.

This reverts that and add exception for bundle cmds based on
annotation available on cmd. Now all cmd will have client initialization
and cmd with annotation kubernetes=false will be exempted.

Fix tektoncd#1874
tekton-robot pushed a commit that referenced this issue Feb 1, 2023
This will fix the issue for taskrun list command
not working and throwing error regarding cluster-scope
as the client is not getting initialized before and namespace
is empty if not passed specifically.

The client initialization happening in every cmd init was removed
because it was getting initialized in all cmds but not required in
cmd like bundle and hence bundle cmd failing with kube config error
which was not required.

This reverts that and add exception for bundle cmds based on
annotation available on cmd. Now all cmd will have client initialization
and cmd with annotation kubernetes=false will be exempted.

Fix #1874
vinamra28 pushed a commit that referenced this issue Feb 2, 2023
This will fix the issue for taskrun list command
not working and throwing error regarding cluster-scope
as the client is not getting initialized before and namespace
is empty if not passed specifically.

The client initialization happening in every cmd init was removed
because it was getting initialized in all cmds but not required in
cmd like bundle and hence bundle cmd failing with kube config error
which was not required.

This reverts that and add exception for bundle cmds based on
annotation available on cmd. Now all cmd will have client initialization
and cmd with annotation kubernetes=false will be exempted.

Fix #1874
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant