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

Support setting image_volume_mode in containers.conf #1037

Merged
merged 2 commits into from
May 19, 2022

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented May 13, 2022

Begins to fix containers/podman#14230

Signed-off-by: Daniel J Walsh [email protected]

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 13, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -487,6 +487,16 @@ Default transport method for pulling and pushing images.
Maximum number of image layers to be copied (pulled/pushed) simultaneously.
Not setting this field will fall back to containers/image defaults. (6)

**image_volume_mode**="bind"
Copy link
Member

Choose a reason for hiding this comment

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

I think that belongs into the [containers] table.

Copy link
Member Author

Choose a reason for hiding this comment

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

No it was added to the [engine] table elsewhere.

Copy link
Member

@vrothberg vrothberg May 13, 2022

Choose a reason for hiding this comment

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

Why is it part of [engine]? To me it feels more on the [containers] side of things as it controls internals of a container but not of the engine.

Copy link
Member Author

Choose a reason for hiding this comment

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

I hate that there is a difference, since I am debating all the time myself. Here is how the man page describes them.

## CONTAINERS TABLE
The containers table contains settings to configure and manage the OCI runtime.

# ENGINE TABLE
The `engine` table contains configuration options used to set up container engines such as Podman and Buildah.

Since this option is done by the engine and not the OCI runtime, I think it belongs in the engine.

Copy link
Member Author

Choose a reason for hiding this comment

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

But I can be swayed...

Copy link
Member

Choose a reason for hiding this comment

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

I agree, it's really hard to classify. I am OK with keeping it in the engine table

pkg/config/config.go Outdated Show resolved Hide resolved
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

**image_volume_mode**="bind"

Tells container engines how to handle the builtin image volumes.
• bind: An anonymous named volume will be created and mounted
Copy link
Member

Choose a reason for hiding this comment

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

The extra whitespace here looks weird. Which of these values is the default?

Copy link
Member Author

Choose a reason for hiding this comment

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

image_volume_mode="bind"
Shows the default is "bind".

Copy link
Member Author

Choose a reason for hiding this comment

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

@nalind Check it out now, it looks like it renders correctly in markdown and as a man page.

@ashley-cui
Copy link
Member

LGTM other than @nalind's comment

pkg/config/containers.conf Outdated Show resolved Hide resolved
pkg/config/containers.conf Outdated Show resolved Hide resolved
pkg/config/containers.conf Outdated Show resolved Hide resolved
pkg/config/default.go Outdated Show resolved Hide resolved
@rhatdan rhatdan force-pushed the volumes branch 4 times, most recently from b34f5a4 to 0859235 Compare May 18, 2022 03:16
Copy link
Member

@nalind nalind left a comment

Choose a reason for hiding this comment

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

pkg/config.Config has a good number of methods that just return the contents of a field in the structure that's already public, and a number of fields for which there is no corresponding method, so I don't know if this new field is supposed to have one added for it as well.

Otherwise it's mostly nits.

pkg/config/default.go Outdated Show resolved Hide resolved
docs/containers.conf.5.md Outdated Show resolved Hide resolved
@@ -46,6 +47,8 @@ const (
BoltDBStateStore RuntimeStateStore = iota
)

var validImageVolumeModes = []string{"bind", "tmpfs", "ignore"}
Copy link
Member

Choose a reason for hiding this comment

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

Values like CgroupfsCgroupsManager and SystemdCgroupsManager are named constants. Why the inconsistency?

pkg/config/config.go Outdated Show resolved Hide resolved
pkg/config/containers.conf Outdated Show resolved Hide resolved
pkg/config/default.go Outdated Show resolved Hide resolved
pkg/config/default.go Outdated Show resolved Hide resolved
pkg/config/default.go Outdated Show resolved Hide resolved
func (c *Config) Env() []string {
return c.Containers.Env
}

// InitPath returns the default init path to add to containers
// InitPath returns the default init path to add to containers.
Copy link
Member

Choose a reason for hiding this comment

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

I have no idea what this comment is saying.

pkg/config/default.go Outdated Show resolved Hide resolved
@rhatdan rhatdan force-pushed the volumes branch 2 times, most recently from 9f4d0cb to d34ec66 Compare May 18, 2022 14:32
@rhatdan rhatdan added the lgtm label May 19, 2022
@openshift-merge-robot openshift-merge-robot merged commit 280c6f6 into containers:main May 19, 2022
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.

Set system wide default behavior of podman run --image-volume to one of the available options
5 participants