-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
specgen: do not set OOMScoreAdj by default #13765
specgen: do not set OOMScoreAdj by default #13765
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe 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 |
cmd/podman/common/create.go
Outdated
@@ -348,8 +348,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, | |||
) | |||
|
|||
oomScoreAdjFlagName := "oom-score-adj" | |||
createFlags.IntVar( | |||
&cf.OOMScoreAdj, | |||
createFlags.Int64( |
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.
Flag should be Int
and not Int64
since you cast later to an int again.
cmd/podman/containers/create.go
Outdated
@@ -238,6 +238,15 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra | |||
vals.GroupAdd = groups | |||
} | |||
|
|||
if c.Flags().Changed("oom-score-adj") { | |||
val := c.Flag("oom-score-adj").Value.String() |
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.
use c.Flags().GetInt("oom-score-adj")
instead
hack/libsubid_tag.sh
Outdated
if test $? -eq 0 ; then | ||
echo libsubid | ||
fi |
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.
This doesn't look related to this PR/commit
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 a lot, @giuseppe!
Which API are you referring to re: the breaking change? I fail to find the break in the remote API which we should keep stable.
hack/libsubid_tag.sh
Outdated
@@ -24,6 +24,3 @@ int main() { | |||
return 0; | |||
} | |||
EOF | |||
if test $? -eq 0 ; then | |||
echo libsubid | |||
fi |
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.
Could you move that into a separate commit? We probably need to cherry-pick the OOM fix.
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.
no that is some debug change that should not be committed
029b813
to
8dd4809
Compare
@mheon PTAL, a candidate for another v4.0 backport. |
8dd4809
to
2b5f57f
Compare
test/system/030-run.bats
Outdated
|
||
@test "podman run doesn't override oom-score-adj" { | ||
current_oom_score_adj=$(cat /proc/self/oom_score_adj) | ||
run_podman '?' run --rm $IMAGE cat /proc/self/oom_score_adj |
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.
run_podman '?' run --rm $IMAGE cat /proc/self/oom_score_adj | |
run_podman run --rm $IMAGE cat /proc/self/oom_score_adj |
We should make sure exit code is 0 or is there a special reason to not check for that?
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.
no, there is no good reason for doing it. I'll drop the ?
2b5f57f
to
4456d9a
Compare
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, thanks!
4456d9a
to
9c8fe82
Compare
do not force a value of OOMScoreAdj=0 if it is wasn't specified by the user. Closes: containers#13731 Signed-off-by: Giuseppe Scrivano <[email protected]>
9c8fe82
to
164b64e
Compare
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
/lgtm |
do not force a value of OOMScoreAdj=0 if it is wasn't specified by the
user.
Closes: #13731
Signed-off-by: Giuseppe Scrivano [email protected]