github.com/octohelm/wagon@v0.0.0-20240308040401-88662650dc0b/pkg/engine/plan/task/version.go (about)

     1  package task
     2  
     3  import (
     4  	"github.com/octohelm/wagon/pkg/engine/plan"
     5  	"github.com/octohelm/wagon/pkg/engine/plan/task/core"
     6  	"golang.org/x/net/context"
     7  )
     8  
     9  func init() {
    10  	core.DefaultFactory.Register(&Version{})
    11  }
    12  
    13  type Version struct {
    14  	core.Task
    15  
    16  	Output string `json:"-" wagon:"generated,name=output"`
    17  }
    18  
    19  func (v *Version) Do(ctx context.Context) error {
    20  	v.Output = plan.MetaContext.From(ctx).Version
    21  	return nil
    22  }