-
Notifications
You must be signed in to change notification settings - Fork 201
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
changing value of DefaultInfraImage #909
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: noracenofun The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg/config/default.go
Outdated
@@ -46,7 +46,7 @@ var ( | |||
// DefaultInitPath is the default path to the container-init binary | |||
DefaultInitPath = "/usr/libexec/podman/catatonit" | |||
// DefaultInfraImage to use for infra container | |||
DefaultInfraImage = "k8s.gcr.io/pause:3.5" | |||
DefaultInfraImage = "localhost/podman-pause:Version-Built" |
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.
Please remove :Version-Built
Does this work when you attempt to use it?
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.
Is only a string, as said, the simplest solution
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.
But if this default is used somewhere it will fail.
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.
But it should not be.
pod_create.go :: func pullOrBuildInfraImage
...
if imageName != config.DefaultInfraImage {
_, err := rt.LibimageRuntime().Pull(context.Background(), imageName, config.PullPolicyMissing, nil)
if err != nil {
return err
}
} else {
name, err := buildPauseImage(rt, rtConfig)
if err != nil {
return fmt.Errorf("building local pause image: %w", err)
}
imageName = name
}
...
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 think the default should be ""
Then if the user does not enter an imageName, it will use buildPauseImage.
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.
The info of the default image would disappear, but also a little user experience and the output should than be
$ podman pod create --help | grep infra-image
--infra-image string The image of the infra container to associate with the pod
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.
Change the help to state
Image to use for infra container, rather then builtin.
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 would be a change of containers/podman/.../pods/create.go in line 78. Can you do this? I hope.
@Luap99 @vrothberg PTAL |
Please squash the commits |
the new default image in 4.0.0-rc2 is a locally built one based on a local pause binary, build result e.g. "localhost/podman-pause:4.0.0-rc2-1642795764" and no longer the image "k8s.gcr.io/pause:3.5", but the command `podman pod create --help` does not yet support this feature for the output of the default infra-image changing value of DefaultInfraImage update string ":Version-Built" removed Signed-off-by: noracenofun <62801810+noracenofun@users.noreply.github.com> changing value of DefaultInfraImage final default value removed Signed-off-by: noracenofun <62801810+noracenofun@users.noreply.github.com>
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 is a breaking change. Podman semantics rely on that behavior:
- The local pause image is only built/used by Podman if the specified infra-image != config.DefaultInfraImage.
- Setting it to "" will now yield building the local image even if the user specified a custom image.
I am against merging this PR and rather fix the help messages in Podman.
This is not quite correct. 4.0.0-rc2
no default configuration of infra_image in any containers.conf
==> result: a local image was built and the default configuration of DefaultInfraImage in default.go was ignored This shows that if there is no default configuration of infra_image in a containers.conf the current situation is
==> result: building the local image and the future constellation would be
==> result: building the local image So setting it to "" would be the same result, and setting infra-image via option --infra-image or containers.conf would end in a pull.
==> result: pulling the image foobar
This means that DefaultInfraImage is currently used only for deciding whether to built a local image or use the image configured via the --infra--image option or containers.conf. Another suggestion instead of "" DefaultInfraImage="builtin" |
Yes, that's exactly what I meant above.
Yes, because that is the hard-coded default. What's your goal? Do you want to pull the k8s pause image or do you want to correct the output of the --help message? |
Yes, the goal should be if the user does not specify an image to use, we use the local image. Similarly if the containers.conf does not specify a image to pull we build the local image. So help should be specify pause image to use, rather then the built in image. BTW, almost no one will override. |
This assuage is not correct.
The opposite is the case
My goal: Eliminate user confusion due to incorrect behavior of the default configuration via DefaultInfraImage. So the output of the --help message should be correct. However, if DefaultInfraImage is set by a value, it would be used by spf13/pflag/flag.go (line 724) for the output in the help message.
|
Please change the defaults in
That can easily be changed in the help message. Instead of calling it default, the message should describe it as a "custom" infra image that is pulled from the registry. |
because of issue containers/podman #12771
the new default image in 4.0.0-rc2 is a locally built one based on a local pause binary, build result e.g. "localhost/podman-pause:4.0.0-rc2-1642795764" and no longer the image "k8s.gcr.io/pause:3.5", but the command
podman pod create --help
does not yet support this feature for the output of the default infra-imagesimplest solution - changing value of DefaultInfraImage
before correction
should be like this after correction