-
Notifications
You must be signed in to change notification settings - Fork 56
Use /root
as home dir instead of /home/nonroot
when running as root
#1100
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ishan16696
reviewed
May 21, 2025
`etcd-backup-restore` uses the `os.HomeDir()` when using the local provider, so we must mount the container properly to `/root` when running as `root` user.
Not needed to change the permissions when already running as root
ishan16696
approved these changes
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
anveshreddy18
approved these changes
May 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. LGTM!
8 tasks
Shreyas-s14
pushed a commit
to Shreyas-s14/etcd-druid
that referenced
this pull request
Jun 4, 2025
…oot` (gardener#1100) * Prefactor: Make `getBackupStoreProvider` func reusable * Adapt mount path for local bucket when running as `root` `etcd-backup-restore` uses the `os.HomeDir()` when using the local provider, so we must mount the container properly to `/root` when running as `root` user. * Do not use init container when running as root Not needed to change the permissions when already running as root * Address PR review feedback
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/usability
Usability related
kind/bug
Bug
needs/ok-to-test
Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD)
needs/review
Needs review
size/m
Size of pull request is medium (see gardener-robot robot/bots/size.py)
status/closed
Issue is closed (either delivered or triaged)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
How to categorize this PR?
/area usability
/kind bug
What this PR does / why we need it:
In #1088, we introduced
spec.runAsRoot
in theEtcd
API. However, when set totrue
and when using thelocal
provider for backups, the bucket path is mounted to/home/nonroot
. This does not play well together withetcd-backup-restore
which uses the home directory for looking up the bucket: https://github.com/gardener/etcd-backup-restore/blob/beafd20c79dd41e266c303590e3fe8cc316a46bb/pkg/snapstore/utils.go#L72-L76This PR changes the mount path to
/root
when.spec.runAsRoot
is set totrue
. The init container is not needed in this case.Which issue(s) this PR fixes:
Follow-up of #1088
Special notes for your reviewer:
/cc @unmarshall @anveshreddy18
Release note: