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

run: Add --uts flag #1683

Merged
merged 2 commits into from
Dec 28, 2022
Merged

run: Add --uts flag #1683

merged 2 commits into from
Dec 28, 2022

Conversation

dcantah
Copy link
Member

@dcantah dcantah commented Dec 24, 2022

Adds support for specifying the host UTS namespace (the only thing
docker supported). This also consolidates the namespace options
checks for linux on run into a single function.

@dcantah dcantah force-pushed the uts-flag branch 6 times, most recently from fa180fd to bc79305 Compare December 25, 2022 01:04
@dcantah dcantah marked this pull request as ready for review December 25, 2022 01:42
@Zheaoli
Copy link
Member

Zheaoli commented Dec 25, 2022

Thanks for your PR! In my personal opinion, I think it's unnecessary to change the setPlatformOptions signature in this PR. One PR for one thing, please.

If we need to change all signatures related to internalLabels, maybe we need another issue to discuss it.

@dcantah
Copy link
Member Author

dcantah commented Dec 25, 2022

It's not worth the hassle don't worry about it, I'll move the signature change to another PR (or open an issue and link to this). It was impacting the ability to just easily setup all the NS options enough it seemed warranted, and it's not exported or some relied on API here.

Will try to do this sometime today!

@dcantah
Copy link
Member Author

dcantah commented Dec 26, 2022

@Zheaoli, removed the setPlatformOptions signature change. I'll make an issue/separate PR. Thanks!

@AkihiroSuda
Copy link
Member

@Zheaoli, removed the setPlatformOptions signature change. I'll make an issue/separate PR. Thanks!

Doesn't seem removed

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Dec 27, 2022

A separate PR is preferred, but a separate commit in the same PR is also ok IMHO (for this amount of PR)

@dcantah
Copy link
Member Author

dcantah commented Dec 27, 2022

@Zheaoli, removed the setPlatformOptions signature change. I'll make an issue/separate PR. Thanks!

Doesn't seem removed

It's the same signature still, it's just over multiple lines as it was a bit long. The signature change was:

Before

func setPlatformOptions(
 	ctx context.Context,
 	opts []oci.SpecOpts,
 	cmd *cobra.Command,
 	client *containerd.Client,
 	id string,
 	internalLabels internalLabels,
 ) ([]oci.SpecOpts, internalLabels, error) {

After

func setPlatformOptions(
 	ctx context.Context,
 	opts []oci.SpecOpts,
 	cmd *cobra.Command,
 	client *containerd.Client,
 	id string,
 	internalLabels *internalLabels,
 ) ([]oci.SpecOpts, error) {

but I reverted the after variant after the discussion

@dcantah
Copy link
Member Author

dcantah commented Dec 27, 2022

A separate PR is preferred, but a separate commit in the same PR is also ok IMHO (for this amount of PR)

Yea, this didn't seem too unwieldy to all be in one PR, but I'll just make a separate at this point no worries.

Edit: #1771. I changed the signature a bit more since the above and got rid of passing in opts.

}
internalLabels.pidContainer = pidInternalLabel
opts = append(opts, pidOpts...)

Copy link
Member

Choose a reason for hiding this comment

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

The pidns changes seem irrelevant to utsns, could you consider splitting the commit? Not necessary to open a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, will try and get to today

Copy link
Member Author

Choose a reason for hiding this comment

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

Adds support for specifying the host UTS namespace (the only thing
docker supported), and a small test for this.

Signed-off-by: Danny Canter <danny@dcantah.dev>
This change just consolidates all of the namespace validation/setting
logic into a single function and will return all of the resulting
options.

Signed-off-by: Danny Canter <danny@dcantah.dev>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 723212c into containerd:main Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants