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

[BUG] Export gets segmentation violation if access to cluster resources is forbidden #150

Open
dmartinol opened this issue Mar 7, 2023 · 1 comment
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@dmartinol
Copy link
Contributor

What version of crane are you running, and what are your clutsters+platform
Commit #149
Running export with the new option --cluster-scoped-rbac on cluster where the configured user has no admin role

What did you expect to happen?
To export only the accessible resources

What actually happened?
segmentation violation happened

Please include any relevant logs or errors

INFO[0043] Filtering for kind ClusterRole (1008 found)  
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xe0 pc=0x10110cfe1]

goroutine 1 [running]:
github.com/konveyor/crane/cmd/export.(*ClusterScopedRbacHandler).acceptClusterRole(0xc000565968, {0xc000ee0ba0})
@dmartinol dmartinol added the kind/bug Categorizes issue or PR as related to a bug. label Mar 7, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 7, 2023
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

This issue is currently awaiting triage.
If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members by writing /triage accepted in a comment.

dmartinol added a commit to dmartinol/crane that referenced this issue Mar 7, 2023
djzager added a commit that referenced this issue Mar 10, 2023
* Added cluster=scoped-rbac flag and exporting all these resources in the _cluster folder

* Added ClusterScopeHandler and implemented filtering functions

* Fixed wrong handling of optional flag and set default to false

* typo: Adding SCC when users match

* Moving _clusters under the namespace folder, to have one instance for each exported namespace

* Added admittedResource type to propertly manage resources with same name in differernt groups
Using range instead of reverse loop by index
Reverted use of go 1.18 (removed slices package)

* Update cmd/export/cluster.go

Co-authored-by: David Zager <dzager@redhat.com>

* Update cmd/export/cluster.go

Co-authored-by: David Zager <dzager@redhat.com>

* Fix for #150: initialized filteredClusterRoleBindings

* Added error message

* integrated reviewer's comment

---------

Co-authored-by: David Zager <dzager@redhat.com>
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. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

1 participant