runtime-spec icon indicating copy to clipboard operation
runtime-spec copied to clipboard

add domainname spec entity

Open cdoern opened this issue 3 years ago • 6 comments

add the domainname entity so that container runtimes can add special handling similar to hostname. The current workaround of adding a sysctl for kernel.domainname only works with rootful execution in most cases. This will allow for rootless execution.

container runtimes will be able to add special handling as they do for hostname, using setdomainname to add the entry to /proc/sys/kernel/domainname.

Signed-off-by: Charlie Doern [email protected]

cdoern avatar Aug 07 '22 18:08 cdoern

@giuseppe PTAL

cdoern avatar Aug 07 '22 18:08 cdoern

Nit:

This will allow for rootless execution

I think in commit message following must be extended to specify how a container-runtime should utilize this field, two approach i could think are runtime invokes setdomainname( or the second one is write /proc/sys/kernel/domainname before setting up UTS namespace but is it possible in rootless session ? (Requesting maintainers to confirm)

flouthoc avatar Aug 08 '22 07:08 flouthoc

as @flouthoc pointed out, please update the config schema as well

giuseppe avatar Aug 08 '22 07:08 giuseppe

Nit:

This will allow for rootless execution

I think in commit message following must be extended to specify how a container-runtime should utilize this field, two approach i could think are runtime invokes setdomainname( or the second one is write /proc/sys/kernel/domainname before setting up UTS namespace but is it possible in rootless session ? (Requesting maintainers to confirm)

I think using setdomainname makes the most sense. Currently crun uses sethostname for the hostname.

cdoern avatar Aug 08 '22 14:08 cdoern

What should happen if the sysctl is also specified but with a different value? Should it fail?

AkihiroSuda avatar Aug 10 '22 02:08 AkihiroSuda

@AkihiroSuda Afaik In crun i think sysctl is not allowed at all if OCI spec already has a knob to configure it, for instance i can see for kernel/hostname : https://github.com/containers/crun/blob/main/src/libcrun/linux.c#L3198

flouthoc avatar Aug 10 '22 03:08 flouthoc

@opencontainers/runtime-spec-maintainers Can we merge this?

AkihiroSuda avatar Aug 24 '22 02:08 AkihiroSuda