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

containers.conf: appendable string arrays, Part 1 #1707

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

vrothberg
Copy link
Member

@Luap99 @rhatdan PTAL

This is how I currently imagine the appendable strings to be wired in. But before going ahead, I desire your feedback.

My plan for now is to start with env variables, volumes and mounts. Once that's in, I will tackle the remaining fields. That should make sure that the customer can play with the appendable feature in 4.8. I will only add documentation when all []strings have been transformed.

@vrothberg
Copy link
Member Author

The PR as is compiles in Podman.

@rhatdan
Copy link
Member

rhatdan commented Oct 23, 2023

LGTM, since this will not affect any change until users setup append=true, this really has no change on exisiting users, I believe.

@vrothberg
Copy link
Member Author

LGTM, since this will not affect any change until users setup append=true, this really has no change on exisiting users, I believe.

Yes, existing user will (and must) not be affected by this change.

I am mostly worried about how to move Podman to stop abusing the internal structure/fields and rather use getters. For the upcoming 4.8 release I prefer to focus on what the users need now and then tackle the other fields. I find it hard to estimate the effort.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

Can you add a test case which read the containers.conf and then writes it back with such a field to make sure it gets written correctly.

pkg/config/attributed_string_slice.go Outdated Show resolved Hide resolved
pkg/config/attributed_string_slice.go Outdated Show resolved Hide resolved
@vrothberg
Copy link
Member Author

Now done for Env, Volumes and Mounts. It breaks in Buildah, so it'll need some vendor-dance cleanups.

@vrothberg
Copy link
Member Author

@nalind FYI

Will open PRs tomorrow.

Commit 6506f4f implemented a POC to allow for changing the behavior
when loading multiple container.conf files in sequence.  By default, the
TOML encoder will override existing data/fields with the one specified
in the loaded file.  The POC has demonstrated how this behavior can be
changed to append string slices instead of overriding/replacing them
entirely.

This change is the first step of integrating these appendable string
arrays into containers.conf and starts with enabling the `Env`,
`Mounts`, and `Volumes` fields in the `[Containers]` table.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Oct 24, 2023

@Luap99 Ok to merge?

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, vrothberg

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

@rhatdan
Copy link
Member

rhatdan commented Oct 24, 2023

/hold cancel

@openshift-ci openshift-ci bot merged commit 7977328 into containers:main Oct 24, 2023
7 checks passed
@vrothberg vrothberg deleted the RUN-1934 branch October 24, 2023 14:12
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.

3 participants