engine.#Pull implementation

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-12-09 15:07:52 -05:00
parent 366e967356
commit ff6c7d1c1f
7 changed files with 162 additions and 2 deletions

View File

@@ -7,8 +7,12 @@ import (
"go.dagger.io/dagger/compiler"
)
func withCustomName(v *compiler.Value, format string, a ...interface{}) llb.ConstraintsOpt {
func vertexNamef(v *compiler.Value, format string, a ...interface{}) string {
prefix := fmt.Sprintf("@%s@", v.Path().String())
name := fmt.Sprintf(format, a...)
return llb.WithCustomName(prefix + " " + name)
return prefix + " " + name
}
func withCustomName(v *compiler.Value, format string, a ...interface{}) llb.ConstraintsOpt {
return llb.WithCustomName(vertexNamef(v, format, a...))
}