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

pkg: idtools: export RawTo{Container,Host} #1101

Merged
merged 1 commit into from
Jan 12, 2022

Conversation

cyphar
Copy link
Contributor

@cyphar cyphar commented Jan 12, 2022

While the IDMapping methods are preferable for most users, sometimes it
is necessary to map a single ID using a given mapping. In particular
this is needed for psgo to be able to map the user and group entries in
/proc/$pid/status using the user namespace of the target process.

See containers/psgo#92.
Signed-off-by: Aleksa Sarai [email protected]

@cyphar
Copy link
Contributor Author

cyphar commented Jan 12, 2022

Is IDMap ever JSON-encoded? Is that JSON encoding ever parsed from disk or something similar?

I ask because it would be really nice to switch to rspec.LinuxIDMapping so that different codebases don't need to convert between different implementations of the same three-entry struct. rspec.LinuxIDMapping does have JSON tags but sadly they use camelCase not snake_case (which means they're not the same as the ones used in this repo).

While the IDMapping methods are preferable for most users, sometimes it
is necessary to map a single ID using a given mapping. In particular
this is needed for psgo to be able to map the user and group entries in
/proc/$pid/status using the user namespace of the target process.

Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar cyphar force-pushed the idtools-export-raw-methods branch from c77d938 to e607266 Compare January 12, 2022 02:02
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

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@giuseppe
Copy link
Member

Is IDMap ever JSON-encoded? Is that JSON encoding ever parsed from disk or something similar?

it is at least used to store the mapping used by containers in the containers.json file

@giuseppe giuseppe merged commit 6a0b394 into containers:main Jan 12, 2022
@cyphar cyphar deleted the idtools-export-raw-methods branch January 12, 2022 08:32
@cyphar
Copy link
Contributor Author

cyphar commented Jan 12, 2022

it is at least used to store the mapping used by containers in the containers.json file

Yeah in that case we can't change it.

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.

3 participants