@@ -25,11 +25,11 @@ import (
2525)
2626
2727// SpecOpts sets spec specific information to a newly generated OCI spec
28- type SpecOpts func (context.Context , Client , * containers.Container , * specs. Spec ) error
28+ type SpecOpts func (context.Context , Client , * containers.Container , * Spec ) error
2929
3030// Compose converts a sequence of spec operations into a single operation
3131func Compose (opts ... SpecOpts ) SpecOpts {
32- return func (ctx context.Context , client Client , c * containers.Container , s * specs. Spec ) error {
32+ return func (ctx context.Context , client Client , c * containers.Container , s * Spec ) error {
3333 for _ , o := range opts {
3434 if err := o (ctx , client , c , s ); err != nil {
3535 return err
@@ -40,15 +40,15 @@ func Compose(opts ...SpecOpts) SpecOpts {
4040}
4141
4242// setProcess sets Process to empty if unset
43- func setProcess (s * specs. Spec ) {
43+ func setProcess (s * Spec ) {
4444 if s .Process == nil {
4545 s .Process = & specs.Process {}
4646 }
4747}
4848
4949// WithProcessArgs replaces the args on the generated spec
5050func WithProcessArgs (args ... string ) SpecOpts {
51- return func (_ context.Context , _ Client , _ * containers.Container , s * specs. Spec ) error {
51+ return func (_ context.Context , _ Client , _ * containers.Container , s * Spec ) error {
5252 setProcess (s )
5353 s .Process .Args = args
5454 return nil
@@ -57,7 +57,7 @@ func WithProcessArgs(args ...string) SpecOpts {
5757
5858// WithProcessCwd replaces the current working directory on the generated spec
5959func WithProcessCwd (cwd string ) SpecOpts {
60- return func (_ context.Context , _ Client , _ * containers.Container , s * specs. Spec ) error {
60+ return func (_ context.Context , _ Client , _ * containers.Container , s * Spec ) error {
6161 setProcess (s )
6262 s .Process .Cwd = cwd
6363 return nil
@@ -66,15 +66,15 @@ func WithProcessCwd(cwd string) SpecOpts {
6666
6767// WithHostname sets the container's hostname
6868func WithHostname (name string ) SpecOpts {
69- return func (_ context.Context , _ Client , _ * containers.Container , s * specs. Spec ) error {
69+ return func (_ context.Context , _ Client , _ * containers.Container , s * Spec ) error {
7070 s .Hostname = name
7171 return nil
7272 }
7373}
7474
7575// WithEnv appends environment variables
7676func WithEnv (environmentVariables []string ) SpecOpts {
77- return func (_ context.Context , _ Client , _ * containers.Container , s * specs. Spec ) error {
77+ return func (_ context.Context , _ Client , _ * containers.Container , s * Spec ) error {
7878 if len (environmentVariables ) > 0 {
7979 setProcess (s )
8080 s .Process .Env = replaceOrAppendEnvValues (s .Process .Env , environmentVariables )
@@ -85,7 +85,7 @@ func WithEnv(environmentVariables []string) SpecOpts {
8585
8686// WithMounts appends mounts
8787func WithMounts (mounts []specs.Mount ) SpecOpts {
88- return func (_ context.Context , _ Client , _ * containers.Container , s * specs. Spec ) error {
88+ return func (_ context.Context , _ Client , _ * containers.Container , s * Spec ) error {
8989 s .Mounts = append (s .Mounts , mounts ... )
9090 return nil
9191 }
0 commit comments