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

Add support for containers.conf #4698

Merged
merged 1 commit into from
Mar 27, 2020

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Dec 13, 2019

vendor in c/common config pkg for containers.conf

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

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 13, 2019
@openshift-ci-robot
Copy link
Collaborator

[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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2019
@rhatdan
Copy link
Member Author

rhatdan commented Dec 13, 2019

Replaces #4569

@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 13, 2019
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #4699) made this pull request unmergeable. Please resolve the merge conflicts.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 13, 2019
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 16, 2019
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #4730) made this pull request unmergeable. Please resolve the merge conflicts.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 19, 2019
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 19, 2019
@rhatdan rhatdan force-pushed the containers.conf branch 3 times, most recently from 242b1aa to 8384542 Compare January 6, 2020 22:34
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #4592) made this pull request unmergeable. Please resolve the merge conflicts.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2020
@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #4816) made this pull request unmergeable. Please resolve the merge conflicts.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 15, 2020
@mheon
Copy link
Member

mheon commented Mar 19, 2020

Please don't merge today, before I cut 1.8.2 final. Will do a review this afternoon.

@rhatdan
Copy link
Member Author

rhatdan commented Mar 19, 2020

/hold
@mheon is in charge of cancelling, unless I get sent back to the drawing board

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 19, 2020
@mheon
Copy link
Member

mheon commented Mar 19, 2020

/hold cancel

Full review delayed until tomorrow

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 19, 2020
@rhatdan
Copy link
Member Author

rhatdan commented Mar 21, 2020

@mheon @vrothberg @giuseppe @TomSweeneyRedHat @QiWang19 @baude Could some give this a review, so we can finally get it merged...

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.

Just a couple of nits. It's very hard to review such a gigantic PR but the green tests (in addition with the new tests) give me a good feeling.

What worries me a bit is that the CLI and API v2 are diverging with all the new defaults being set in cmd/podman/.... I didn't catch up on all recent developments and I am certain that's already being worked on but it would be great to consolidate container creation (and let the backend do the validation in contrast to cmd/podman/...).

Other than that LGTM.

// Check for . and dns-search domains
if util.StringInSlice(".", dnsSearches) {
if len(dnsSearches) > 1 {
return nil, errors.Errorf("cannot pass additional search domains when also specifying '.'")
Copy link
Member

Choose a reason for hiding this comment

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

We could move the check down to if dom == "." in the following loop. Would avoid iterating twice.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@@ -867,6 +869,8 @@ Set the user namespace mode for the container. It defaults to the **PODMAN_USER
- **host**: run in the user namespace of the caller. This is the default if no user namespace options are set. The processes running in the container will have the same privileges on the host as any other process launched by the calling user.
- **keep-id**: creates a user namespace where the current rootless user's UID:GID are mapped to the same values in the container. This option is ignored for containers created by the root user.
- **ns**: run the container in the given existing user namespace.
- **private**: create a new namespace for the container (default)
- **private**:
Copy link
Member

Choose a reason for hiding this comment

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

This line can be deleted.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@@ -609,3 +609,46 @@ func Tmpdir() string {

return tmpdir
}

// ValidateSysctls validates a list of sysctl and returns it.
func ValidateSysctls(strSlice []string) (map[string]string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like a candidate for a c/common/pkg/sysctl.

Copy link
Member Author

Choose a reason for hiding this comment

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

WIll open a different PR for this, but I would prefer to get this merged and fixed later.

Copy link
Member

Choose a reason for hiding this comment

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

Completely agree 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

}

// If we need to, switch to cgroupfs and logger=file on rootless.
config.checkCgroupsAndLogger()
Copy link
Contributor

Choose a reason for hiding this comment

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

should use func (c *Config) CheckCgroupsAndAdjustConfig() directly in podman. containers/common#80 removed it from NewConfig

Copy link
Member Author

Choose a reason for hiding this comment

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

Good Catch,
Fixed

@rhatdan rhatdan force-pushed the containers.conf branch 2 times, most recently from ccc88dd to c634565 Compare March 23, 2020 18:28
@rhatdan
Copy link
Member Author

rhatdan commented Mar 23, 2020

@mheon @vrothberg @QiWang19 @TomSweeneyRedHat @baude @jwhonce PTAL
Fixed up issues.

@umohnani8
Copy link
Member

LGTM

@rhatdan
Copy link
Member Author

rhatdan commented Mar 24, 2020

@mheon @vrothberg @QiWang19 @TomSweeneyRedHat @baude @jwhonce @giuseppe PTAL
Could we get this in...

@rhatdan rhatdan force-pushed the containers.conf branch 3 times, most recently from 0ec7c52 to c1caffb Compare March 27, 2020 17:00
vendor in c/common config pkg for containers.conf

Signed-off-by: Qi Wang [email protected]
Signed-off-by: Daniel J Walsh <[email protected]>
@baude
Copy link
Member

baude commented Mar 27, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2020
@openshift-merge-robot openshift-merge-robot merged commit 3336b10 into containers:master Mar 27, 2020
@vrothberg
Copy link
Member

vrothberg commented Mar 30, 2020

@baude @jwhonce @mheon @rhatdan ... while working on pull I found that the v2 binary is now failing for all invocations with Error: eventer creation: No support for journald logging. Looks like this PR introduced it.

I will look into it but we really need some sort of CI for podmanV2.

@vrothberg
Copy link
Member

K. It turns out we just need to specify the systemd build tag.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.