Skip to content

frontend: Missing restart option despite enough permissions #5906

@wiswesser

Description

@wiswesser

Describe the bug

The only permission a user needs to restart a resource is the ability to patch the resource. It follows that a user with e.g. the permission to patch a deployment should also see the option to restart the deployment in headlamp. This is however not the case.
The reason is that Headlamp checks if the user has the "update" permission instead.
Inversely that also means that a user with only the ability to update deployments sees a Restart Button, but gets an error when trying to user it. (After all they are not authorised to do so).

To Reproduce

Steps to reproduce the bug:

  1. Create a user with only the ability to patch, not update, deployments.
  2. Confirm the ability to restart deployments by running "kubectl rollout restart deployment "
  3. Switch to the deployment view in headlamp and click on the three dots
  4. There is no restart button.

Environment (please provide info about your environment):

  • Installation type: Windows (Though I suspect this does not matter)
  • Headlamp Version: 0.41.0
  • Other: None

Are you able to fix this issue?

If this is confirmed to be a bug that should be fixed, I'm happy to make a pull request replacing the update with patch. But I'll probably not have the time to test this thoroughly or anything.

Additional Context

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions