X Tutup
Skip to content

Commit fc51e56

Browse files
committed
oci: add TODO comments
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
1 parent 2b04186 commit fc51e56

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

oci/spec_opts_unix.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ func WithImageConfig(image Image) SpecOpts {
102102
}
103103
s.Process.Cwd = cwd
104104
if config.User != "" {
105+
// According to OCI Image Spec v1.0.0, the following are valid for Linux:
106+
// user, uid, user:group, uid:gid, uid:group, user:gid
105107
parts := strings.Split(config.User, ":")
106108
switch len(parts) {
107109
case 1:
@@ -114,6 +116,7 @@ func WithImageConfig(image Image) SpecOpts {
114116
return err
115117
}
116118
case 2:
119+
// TODO: support username and groupname
117120
v, err := strconv.Atoi(parts[0])
118121
if err != nil {
119122
return errors.Wrapf(err, "parse uid %s", parts[0])
@@ -257,6 +260,7 @@ func WithUIDGID(uid, gid uint32) SpecOpts {
257260
// uid, and not returns error.
258261
func WithUserID(uid uint32) SpecOpts {
259262
return func(ctx context.Context, client Client, c *containers.Container, s *specs.Spec) (err error) {
263+
// TODO: support non-snapshot rootfs
260264
if c.Snapshotter == "" {
261265
return errors.Errorf("no snapshotter set for container")
262266
}
@@ -319,6 +323,7 @@ func WithUserID(uid uint32) SpecOpts {
319323
// does not exist, or the username is not found in /etc/passwd,
320324
// it returns error.
321325
func WithUsername(username string) SpecOpts {
326+
// TODO: support non-snapshot rootfs
322327
return func(ctx context.Context, client Client, c *containers.Container, s *specs.Spec) (err error) {
323328
if c.Snapshotter == "" {
324329
return errors.Errorf("no snapshotter set for container")

0 commit comments

Comments
 (0)
X Tutup