Skip to content

Move RunningInUserNS() to its own package#5252

Merged
estesp merged 1 commit intocontainerd:masterfrom
thaJeztah:separate_userns
Mar 23, 2021
Merged

Move RunningInUserNS() to its own package#5252
estesp merged 1 commit intocontainerd:masterfrom
thaJeztah:separate_userns

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Trying to prevent the sys package to become too much of a kitchen-sink 😅

This allows using the utility without bringing whole of "sys" with it.

@thaJeztah
Copy link
Copy Markdown
Member Author

@AkihiroSuda @estesp ptal 🤗

Copy link
Copy Markdown
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.

LGTM, but maybe we want to add RunningInUserNS = userns.RunningInUserNS alias in sys to reduce vendoring issues

@thaJeztah
Copy link
Copy Markdown
Member Author

maybe we want to add RunningInUserNS = userns.RunningInUserNS alias in sys to reduce vendoring issues

I recall a discussion around sys not intended for external use (so no backward compatibility); that said; happy to add an alias; let me add one, and we can decide if we keep that or not

This allows using the utility without bringing whole of "sys" with it.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member Author

Updated and added an alias

@AkihiroSuda
Copy link
Copy Markdown
Member

I recall a discussion around sys not intended for external use (so no backward compatibility)

I guess that discussion was about libcontainer/system?
runc (libcontainer) is not really intended to be used as a library today, but containerd is still intended to be used as a library.

Anyway, we don't strictly guarantee compatibility of Go API, so this LGTM.

Copy link
Copy Markdown
Member

@dims dims left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Copy Markdown
Member Author

I guess that discussion was about libcontainer/system?

No, it was about containerd/sys (don't recall the details, but I think it was more that sys was mostly an "internal" utility package). The alias is just a "one line" thing (well, boiler plating is more than the actual code 😂), so I'm 👍 for having the alias to ease the transition.

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 717dde3 into containerd:master Mar 23, 2021
@thaJeztah thaJeztah deleted the separate_userns branch March 23, 2021 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants