canonical / canonical/operator

Example (including tutorial) K8s charms should set charm-user

Open
#2,048 2 comments 0 reactions 0 assignees View on GitHub
docs rainy day small item
Dominant language
Python
Stars
267
Forks
136
Avg merge
1d 22h
Merged PRs (30d)
28

Description

We should be able to set [charm-user](https://documentation.ubuntu.com/charmcraft/stable/reference/files/charmcraft-yaml-file/#charm-user) to `non-root` (or at least `sudoer`) for the Zero-to-Hero charm and any example charms. We should set `uid` and `gid` for the container as well, I believe.

I'm not sure if this would be a "needs to wait until Charmcraft 5" item, but I wonder if we also should have the `kubernetes` profile have this set to `non-root` with a comment (and link to the docs) that it can be changed if the charm has to run as root or have sudo for some reason. Defaulting to the lower privileges is generally a good idea.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.