Fix spec generation for task execution

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-05-24 15:40:40 -07:00
parent 923236004a
commit bf9ad0c57f
6 changed files with 128 additions and 36 deletions

11
spec.go
View File

@@ -14,13 +14,6 @@ func WithImageRef(ref string) SpecOpts {
}
}
func WithHostname(id string) SpecOpts {
return func(s *specs.Spec) error {
s.Hostname = id
return nil
}
}
func WithArgs(args ...string) SpecOpts {
return func(s *specs.Spec) error {
s.Process.Args = args
@@ -30,8 +23,8 @@ func WithArgs(args ...string) SpecOpts {
// GenerateSpec will generate a default spec from the provided image
// for use as a containerd container
func GenerateSpec(opts ...SpecOpts) (*specs.Spec, error) {
s, err := createDefaultSpec()
func GenerateSpec(id string, opts ...SpecOpts) (*specs.Spec, error) {
s, err := createDefaultSpec(id)
if err != nil {
return nil, err
}