Skip to content

resolve shoot command should not require the permission to list projects #557

Open
@petersutter

Description

@petersutter

What happened:
When running the resolve shoot command as regular project admin, it should succeed. Currently it fails with the error:

gardenctl resolve shoot
Error: failed to fetch project by namespace: failed to list projects: projects.core.gardener.cloud is forbidden: User "[email protected]" cannot list resource "projects" in API group "core.gardener.cloud" at the cluster scope

when o.CurrentTarget.ProjectName() is not empty, it should take this value to read the project instead of calling

project, err := o.GardenClient.GetProjectByNamespace(ctx, shoot.Namespace)
if err != nil {
return err
}

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

Environment:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions