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

fix pod creation with "new:" syntax #7152

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jul 29, 2020

When you execute podman create/run with the --pod new:<name> syntax
the pod was created but the namespaces where not shared and
therefore containers could not communicate over localhost.

Add the default namespaces and pass the network options to the
pod create options.

Closes #7087

@rhatdan
Copy link
Member

rhatdan commented Jul 29, 2020

LGTM
@mheon @baude @haircommander @ashley-cui PTAL

Name: podName,
Infra: true,
Net: netOpts,
Share: strings.Split(specgen.DefaultKernelNamespaces, ","),
Copy link
Member

Choose a reason for hiding this comment

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

It looks like we need to make sure that the defaults are used in Specgen if this is unset.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Yes - that looks right. If the argument to that is nil, we should return the defaults. A 0-length non-nil array would indicate nothing is shared.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, updated.

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, 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 /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 Jul 30, 2020
Name: podName,
Infra: true,
Net: netOpts,
CreateCommand: os.Args,
Copy link
Member

Choose a reason for hiding this comment

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

Probably best to leave this empty - it's mainly used for podman generate systemd --new, and it could have misleading results there

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 believe it is correct to set here. I checked podman generate systemd --new and it throws an error that you have to use podman pod create. This can later be used to implement this.

Copy link
Member

Choose a reason for hiding this comment

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

@vrothberg Thoughts here?

Copy link
Member

Choose a reason for hiding this comment

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

It looks good to me. As @Luap99 mentioned, generate systemd requires a pod to be generated via pod create and will error out otherwise (see https://github.com/containers/podman/blob/master/pkg/systemd/generate/pods.go#L265).

Setting it here will be more accurate as generate systemd will otherwise error out with "no create command found" which would be less informative than "pod does not appear to be created via podman pod create"

Copy link
Member

Choose a reason for hiding this comment

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

Alright. We should be good to merge after a rebase, then.

@mheon
Copy link
Member

mheon commented Jul 30, 2020

One more comment, LGTM once it's addressed

@mheon
Copy link
Member

mheon commented Jul 31, 2020

Needs a rebase to fix CI

@TomSweeneyRedHat
Copy link
Member

LGTM
assuming happy tests

When you execute podman create/run with the --pod new:<name> syntax
the pod was created but the namespaces where not shared and
therefore containers could not communicate over localhost.

Add the default namespaces and pass the network options to the
pod create options.

Signed-off-by: Paul Holzinger <[email protected]>
@Luap99
Copy link
Member Author

Luap99 commented Jul 31, 2020

One test still failed! A Flake?

@mheon
Copy link
Member

mheon commented Jul 31, 2020

Looking...

@mheon
Copy link
Member

mheon commented Jul 31, 2020

I've never seen this one before - going to assume it's a flake and restart...

@Luap99
Copy link
Member Author

Luap99 commented Jul 31, 2020

Now it timed out! :(

@Luap99
Copy link
Member Author

Luap99 commented Jul 31, 2020

@mheon Test is green :)

@mheon
Copy link
Member

mheon commented Jul 31, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 31, 2020
@openshift-merge-robot openshift-merge-robot merged commit 4c75fe3 into containers:master Jul 31, 2020
@Luap99 Luap99 deleted the fix#7087 branch January 2, 2021 20:17
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rootless containers cannot connect using the local host on the same pod
8 participants