-
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
Implement Podman Container Clone #13059
Conversation
0766f36
to
792e011
Compare
7bc7c2a
to
73ed0cc
Compare
b53d4ef
to
42e5df6
Compare
@containers/podman-maintainers PTAL, this works and is set up in such a way that more options can basically be dropped in over time.
|
@containers/podman-maintainers PTAL, I think I am done making major changes to this before v1, let me know if there are any glaring issues. |
ctrClone.CreateOpts.Name = args[1] | ||
case 3: | ||
ctrClone.CreateOpts.Name = args[1] | ||
ctrClone.Image = args[2] |
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.
Does this properly handle image environment variables, healthchecks, etc? I think it should merge the ones from the old container with the ones from the new container, but the exact details could be difficult?
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.
well this is only if the user specified a new image to use in the clone, would the env variables just get picked up from the other image by default? I am not really familiar with how that works
d641020
to
2a9303c
Compare
Fixes: #9540 |
@mheon need another pass? |
04c0c3e
to
c4c2981
Compare
podman container clone takes the id of an existing continer and creates a specgen from the given container's config recreating all proper namespaces and overriding spec options like resource limits and the container name if given in the cli options this command utilizes the common function DefineCreateFlags meaning that we can funnel as many create options as we want into clone over time allowing the user to clone with as much or as little of the original config as they want. container clone takes a second argument which is a new name and a third argument which is an image name to use instead of the original container's the current supported flags are: --destroy (remove the original container) --name (new ctr name) --cpus (sets cpu period and quota) --cpuset-cpus --cpu-period --cpu-rt-period --cpu-rt-runtime --cpu-shares --cpuset-mems --memory --run resolves containers#10875 Signed-off-by: cdoern <[email protected]> Signed-off-by: cdoern <[email protected]> Signed-off-by: cdoern <[email protected]>
LGTM |
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
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cdoern, Luap99 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 |
podman container clone takes the id of an existing continer and creates a specgen from the given container's config
recreating all proper namespaces and overriding spec options like resource limits and the container name if given in the cli options
this command utilizes the common function DefineCreateFlags meaning that we can funnel as many create options as we want
into clone over time allowing the user to clone with as much or as little of the original config as they want.
the current supported flags are:
--id (ctr to clone)
--destroy (remove the original container)
--name (new ctr name)
--cpus (sets cpu period and quota)
--cpuset-cpus
--cpu-period
--cpu-rt-period
--cpu-rt-runtime
--cpu-shares
--cpuset-mems
--memory
Signed-off-by: cdoern [email protected]