mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 06:30:37 +02:00
feat(diff,apply): --context=N for limiting diff context (#849)
Resolves #787
This commit is contained in:
@@ -41,6 +41,7 @@ type ApplyConfigProvider interface {
|
||||
SuppressSecrets() bool
|
||||
|
||||
NoColor() bool
|
||||
Context() int
|
||||
|
||||
concurrencyConfig
|
||||
interactive
|
||||
@@ -67,6 +68,7 @@ type DiffConfigProvider interface {
|
||||
|
||||
DetailedExitcode() bool
|
||||
NoColor() bool
|
||||
Context() int
|
||||
|
||||
concurrencyConfig
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ func (r *Run) Apply(c ApplyConfigProvider) []error {
|
||||
|
||||
diffOpts := &state.DiffOpts{
|
||||
NoColor: c.NoColor(),
|
||||
Context: c.Context(),
|
||||
}
|
||||
|
||||
releases, errs := st.DiffReleases(helm, c.Values(), c.Concurrency(), detailedExitCode, c.SuppressSecrets(), false, diffOpts)
|
||||
|
||||
@@ -776,6 +776,10 @@ func (st *HelmState) prepareDiffReleases(helm helmexec.Interface, additionalValu
|
||||
flags = append(flags, "--no-color")
|
||||
}
|
||||
|
||||
if opts.Context > 0 {
|
||||
flags = append(flags, "--context", fmt.Sprintf("%d", opts.Context))
|
||||
}
|
||||
|
||||
if len(errs) > 0 {
|
||||
rsErrs := make([]*ReleaseError, len(errs))
|
||||
for i, e := range errs {
|
||||
@@ -823,6 +827,7 @@ func (st *HelmState) createHelmContext(spec *ReleaseSpec, workerIndex int) helme
|
||||
|
||||
type DiffOpts struct {
|
||||
NoColor bool
|
||||
Context int
|
||||
}
|
||||
|
||||
func (o *DiffOpts) Apply(opts *DiffOpts) {
|
||||
|
||||
Reference in New Issue
Block a user