dagger.#Nop: work around bugs in the DAG resolver
Signed-off-by: Solomon Hykes <solomon@dagger.io>
This commit is contained in:
parent
aacabb1393
commit
9d1e7e2acc
10
pkg/dagger.io/dagger/nop.cue
Normal file
10
pkg/dagger.io/dagger/nop.cue
Normal file
@ -0,0 +1,10 @@
|
||||
package dagger
|
||||
|
||||
// A core action that does nothing
|
||||
// Useful to work around bugs in the DAG resolver.
|
||||
// See for example https://github.com/dagger/dagger/issues/1789
|
||||
#Nop: {
|
||||
$dagger: task: _name: "Nop"
|
||||
input: _
|
||||
output: input
|
||||
}
|
20
plan/task/nop.go
Normal file
20
plan/task/nop.go
Normal file
@ -0,0 +1,20 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.dagger.io/dagger/compiler"
|
||||
"go.dagger.io/dagger/plancontext"
|
||||
"go.dagger.io/dagger/solver"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("Nop", func() Task { return &nopTask{} })
|
||||
}
|
||||
|
||||
type nopTask struct {
|
||||
}
|
||||
|
||||
func (t *nopTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.Solver, v *compiler.Value) (*compiler.Value, error) {
|
||||
return v, nil
|
||||
}
|
Reference in New Issue
Block a user