implement basic exec [ci skip]

This commit is contained in:
Brad Rydzewski
2019-10-22 15:21:57 -07:00
parent 00df09b842
commit 4d3f9c66af
24 changed files with 304 additions and 60 deletions

View File

@@ -369,6 +369,30 @@ func (c *Compiler) Compile(ctx context.Context, args Args) *engine.Spec {
}
}
// append volumes
for _, v := range args.Pipeline.Volumes {
id := random()
src := new(engine.Volume)
if v.EmptyDir != nil {
src.EmptyDir = &engine.VolumeEmptyDir{
ID: id,
Name: v.Name,
Medium: v.EmptyDir.Medium,
SizeLimit: int64(v.EmptyDir.SizeLimit),
Labels: labels,
}
} else if v.HostPath != nil {
src.HostPath = &engine.VolumeHostPath{
ID: id,
Name: v.Name,
Path: v.HostPath.Path,
}
} else {
continue
}
spec.Volumes = append(spec.Volumes, src)
}
return spec
}