diff --git a/internal/helm/plan.go b/internal/helm/plan.go index ea184f3..61bc98e 100644 --- a/internal/helm/plan.go +++ b/internal/helm/plan.go @@ -62,7 +62,7 @@ func determineSteps(cfg Config) *func(Config) []Step { case "delete": panic("not implemented") case "lint": - panic("not implemented") + return &lint case "help": return &help default: @@ -116,6 +116,14 @@ var upgrade = func(cfg Config) []Step { return steps } +var lint = func(cfg Config) []Step { + lint := &run.Lint{ + Chart: cfg.Chart, + } + + return []Step{lint} +} + var help = func(cfg Config) []Step { help := &run.Help{} return []Step{help} diff --git a/internal/helm/plan_test.go b/internal/helm/plan_test.go index 716a27c..34708e6 100644 --- a/internal/helm/plan_test.go +++ b/internal/helm/plan_test.go @@ -137,6 +137,20 @@ func (suite *PlanTestSuite) TestUpgrade() { suite.Equal(expected, upgrade) } +func (suite *PlanTestSuite) TestLint() { + cfg := Config{ + Chart: "./flow", + } + + steps := lint(cfg) + suite.Equal(1, len(steps)) + + want := &run.Lint{ + Chart: "./flow", + } + suite.Equal(want, steps[0]) +} + func (suite *PlanTestSuite) TestDeterminePlanUpgradeCommand() { cfg := Config{ Command: "upgrade", @@ -156,6 +170,15 @@ func (suite *PlanTestSuite) TestDeterminePlanUpgradeFromDroneEvent() { } } +func (suite *PlanTestSuite) TestDeterminePlanLintCommand() { + cfg := Config{ + Command: "lint", + } + + stepsMaker := determineSteps(cfg) + suite.Same(&lint, stepsMaker) +} + func (suite *PlanTestSuite) TestDeterminePlanHelpCommand() { cfg := Config{ Command: "help",