Skip to content

Commit ecb4e48

Browse files
author
Mrunal Patel
committed
Merge pull request #59 from wking/empty-array-default-for-process.args
generate: Set process.args to an empty array if it was nil
2 parents 3491ecc + 1066a92 commit ecb4e48

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

generate.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ func modify(spec *rspec.Spec, context *cli.Context) error {
133133
spec.Hostname = context.String("hostname")
134134
spec.Process.User.UID = uint32(context.Int("uid"))
135135
spec.Process.User.GID = uint32(context.Int("gid"))
136+
if spec.Process.Args == nil {
137+
spec.Process.Args = make([]string, 0)
138+
}
136139
spec.Process.SelinuxLabel = context.String("selinux-label")
137140
spec.Linux.MountLabel = context.String("mount-label")
138141
spec.Platform.OS = context.String("os")

0 commit comments

Comments
 (0)