-
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
Fix device limitations in podman-remote update
on remote systems
#24760
Fix device limitations in podman-remote update
on remote systems
#24760
Conversation
f3d1418
to
d56f8d4
Compare
podman-remote update
on remote systems
d56f8d4
to
b775b6c
Compare
type ContainerUpdateOptions struct { | ||
NameOrID string | ||
Specgen *specgen.SpecGenerator | ||
Resources *specs.LinuxResources | ||
DevicesLimits *define.UpdateContainerDevicesLimits | ||
ChangedHealthCheckConfiguration *define.UpdateHealthCheckConfig | ||
RestartPolicy *string | ||
RestartRetries *uint |
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 type is used in pkg/bindings/containers Update() function as such we cannot chnage the type as this will break bindings users, we can add new fields but we cannot remove the function of old fields.
b775b6c
to
bd14dd2
Compare
NameOrID string | ||
// Deprecated: Specgen should not be used to change the container configuration. | ||
// Specgen is processed first, so values will be overwritten by values from other fields. | ||
// To change configuration use other fields: | ||
// Resources to change resource configuration, DevicesLimits to Limit device, | ||
// RestartPolicy to change restart policy and RestartRetries to change restart retries. | ||
Specgen *specgen.SpecGenerator | ||
Resources *specs.LinuxResources | ||
DevicesLimits *define.UpdateContainerDevicesLimits | ||
ChangedHealthCheckConfiguration *define.UpdateHealthCheckConfig | ||
RestartPolicy *string | ||
RestartRetries *uint |
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.
@mheon PTAL I never liked using specgen here as it is totally unclear what field are or are not supported so I am fine with this but I am not sure if have objects?
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.
We're not actually using the full thing, so passing a full Specgen feels deceptive. A lot easier to say what we actually support like this.
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.
Updated the doc string with the list of fields that are currently used from SpecGenerator
struct.
ChangedHealthCheckConfiguration *define.UpdateHealthCheckConfig | ||
RestartPolicy *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.
Any reason to define this *string
? It seems pretty clear to me that string
should work fine too. Just leave the string empty if it should not be changed sounds easy enough. I don't see what the extra pointer offers here? Allowing user to set the restart policy to an empty string seems pointless as this is not valid?
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.
I'm sure an empty string would work, but the intent was to be consistent in the representation of the unset value throughout the structure.
bd14dd2
to
c515b67
Compare
Fixes: https://issues.redhat.com/browse/RUN-2381 Signed-off-by: Jan Rodák <[email protected]>
c515b67
to
2f31a61
Compare
Changes LGTM |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Honny1, rhatdan 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 |
This PR fixes device limitations using
podman-remote update
on remote systems. The cause of the problem was that the major and minor numbers were loaded on the client system and then sent to the remote system, where there could be different major and minor numbers for each device.Reproducer in Issue: #24734
Fixes: https://issues.redhat.com/browse/RUN-2381
Fixes: #24734
Does this PR introduce a user-facing change?