Initialize Steps with a NewSTEPNAME function [#67]
This seems to be be a more natural separation of concerns--the knowledge of which config fields map to which parts of a Step belong to the Step, not to the Plan.
This commit is contained in:
@@ -2,6 +2,7 @@ package run
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/pelotech/drone-helm3/internal/env"
|
||||
)
|
||||
|
||||
// Lint is an execution step that calls `helm lint` when executed.
|
||||
@@ -14,6 +15,17 @@ type Lint struct {
|
||||
cmd cmd
|
||||
}
|
||||
|
||||
// NewLint creates a Lint using fields from the given Config. No validation is performed at this time.
|
||||
func NewLint(cfg env.Config) *Lint {
|
||||
return &Lint{
|
||||
Chart: cfg.Chart,
|
||||
Values: cfg.Values,
|
||||
StringValues: cfg.StringValues,
|
||||
ValuesFiles: cfg.ValuesFiles,
|
||||
Strict: cfg.LintStrictly,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the `helm lint` command.
|
||||
func (l *Lint) Execute(_ Config) error {
|
||||
return l.cmd.Run()
|
||||
|
||||
Reference in New Issue
Block a user