This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/plan/task/util.go
Andrea Luzzardi ff6c7d1c1f engine.#Pull implementation
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-12-13 16:13:49 +01:00

19 lines
451 B
Go

package task
import (
"fmt"
"github.com/moby/buildkit/client/llb"
"go.dagger.io/dagger/compiler"
)
func vertexNamef(v *compiler.Value, format string, a ...interface{}) string {
prefix := fmt.Sprintf("@%s@", v.Path().String())
name := fmt.Sprintf(format, a...)
return prefix + " " + name
}
func withCustomName(v *compiler.Value, format string, a ...interface{}) llb.ConstraintsOpt {
return llb.WithCustomName(vertexNamef(v, format, a...))
}