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

Don't use root as default user for exec_run #431

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

aparcar
Copy link
Contributor

@aparcar aparcar commented Sep 23, 2024

Instead use whatever user the container uses per default, which might be root but may also be something else. This avoids manually figuring out the default user in case some files inside the container are specifically owned by a non-root user.

@jwhonce
Copy link
Member

jwhonce commented Sep 24, 2024

@aparcar Interesting change. The docker-py documentation states the default for user is root, but the "as built" code uses an empty string.

/cc @inknos

@openshift-ci openshift-ci bot requested a review from inknos September 24, 2024 05:38
@rhatdan
Copy link
Member

rhatdan commented Sep 24, 2024

Hardcoding to the "root" user will ignore the user within the IMage, which I believe is wrong, so this seems like the proper change.

@rhatdan
Copy link
Member

rhatdan commented Sep 24, 2024

Tests are blowing up, though.

@aparcar
Copy link
Contributor Author

aparcar commented Sep 24, 2024

Looks unrelated to my changes?

@inknos
Copy link
Contributor

inknos commented Sep 24, 2024

Looks unrelated to my changes?

Thanks @aparcar for the pr

We have the same pylint issue on another PR. I am taking a look but can't see what's the cause of the issue at a first glance.

I am ok with the change but let's see if the test's flake disappears. Will come back later to this.

@rhatdan
Copy link
Member

rhatdan commented Sep 24, 2024

/approved
LGTM

I have no idea why gating tests are failing? @jwhonce @lsm5 @umohnani8 Do you know what is going on?

@inknos
Copy link
Contributor

inknos commented Sep 24, 2024

@rhatdan I am on it, PR with a fix in few minutes

Quick explaination of whwat's happening.

Currently, pylint is flaky. With this assumption, we know that sometimes pylint can be right even though it did not complain in the past for no apparent reason.

While this can seem unrelated to this PR it could still be a perfectly valid complaint such for too-many-positional-arguments. It can be disabled for __init__ functions and split with * for public functions.

@inknos
Copy link
Contributor

inknos commented Sep 24, 2024

Linking for ref. Hopefully will see green lights

#432

@inknos
Copy link
Contributor

inknos commented Sep 25, 2024

@aparcar tests should be good now if you want to rebase and test it

Instead use whatever user the container uses per default, which might be
`root` but may also be something else. This avoids manually figuring out
the default user in case some files inside the container are
specifically owned by a non-root user.

Signed-off-by: Paul Spooren <[email protected]>
@aparcar
Copy link
Contributor Author

aparcar commented Sep 25, 2024

Rebased

@umohnani8
Copy link
Member

LGTM

@inknos
Copy link
Contributor

inknos commented Sep 25, 2024

/lgtm

Copy link
Member

@lsm5 lsm5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Copy link
Contributor

openshift-ci bot commented Sep 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aparcar, inknos, lsm5

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit da8fca9 into containers:main Sep 27, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants