Skip to content

Failed to run exporter on OpenShift 4.x  #255

Description

@hrytsai

Describe the bug
When run kor in cluster with exporter flag
kor -exporter --resources secret,configmap,pvc -n kor-test-namespace
We got an error:
Failed to retrieve namespaces: namespaces is forbidden: User "system:serviceaccount:kor-test-namespace:dev-kor" cannot list resource "namespaces" in API group "" at the cluster scope
We faced similiar issue when run kor v0.3.5 without exporter flag, see
#213

To Reproduce
Run kor in cluster with options:
-exporter --resources secret,configmap,pvc -n <namespace_name>

Expected behavior
Namespace will be scanned and result provided without get access to list of namespaces, get only unused resources in provided namespace

OS version, architecture and kor version
OpenShift 4.12
Kor version: 0.3.8

Additional context
For example:
kubectl get ns will return

Error from server (Forbidden): namespaces is forbidden: User "kor-test-user" cannot list resource "namespaces" in API group "" at the cluster scope

but when you run:
kubectl get project
you will get result:

NAME DISPLAY NAME STATUS
...
kor-test-namespace
...
This issue also might be connected to:
#218

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions