helm / chart-testing

CLI tool for linting and testing Helm charts
Apache License 2.0
1.34k stars 215 forks source link

Support custom chart processors via exec-based plugin system #163

Closed jlegrone closed 10 months ago

jlegrone commented 5 years ago

As a way to support custom linting and other chart validation use cases, I propose that we allow users to specify custom chart processors that do not require compilation into ct.

The implementation might look something like this:

type ChartProcessor interface {
    ProcessChart(*Chart) TestResult
}

type ExecManifestProcessor struct {
    Command []string
}

// ProcessChart renders a chart (once for each values file) and executes Command
// passing the rendered manifests as input via Stdin.
//
// Runtime complexity is O(n) where n is the number of CI values files.
func (e ExecManifestProcessor) ProcessChart(chart *Chart) TestResult {
    ...
}

Users would then be able to specify custom processors, eg. an OPA based linter, a shell script, etc.

There are two sorts of plugins which could be supported:

  1. Those which can accept a set of pre-rendered yaml manifests via Stdin
  2. Those which accept a helm chart path as input

The ct configuration should distinguish between these two types, and more may be added in the future (eg. processors which accept JSON manifests as input).

Other Considerations

  1. We could just build support for new processors directly into ct. This would be a better experience for end users, but is not scalable. Custom processors may still "graduate" to directly supported default plugins like helm lint.
  2. We could explicitly support using ct as a go library and allow others to build their own CLIs that integrate custom processors. This might lead to fragmentation, and isn't a satisfactory solution for those who have simple needs.
github-actions[bot] commented 10 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 10 months ago

This issue was closed because it has been stalled for 5 days with no activity.

cornfeedhobo commented 9 months ago

@jlegrone @unguiculus @scottrigby Can we revisit this topic?

@griffin Why did you close #165?