mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-20 06:06:54 +02:00
Expose internal apis (#2520)
* feat: expose WithPreparedCharts and SyncRun This exposes the previously internal functions withPreparedCharts and sync to be used by tooling built on top of helmfile Co-authored-by: Raphael Luba <raphael@leanbyte.com> Signed-off-by: Niklas Ott <niklas.ott@unwired.at> * feat: expose Helm interface and HelmState This adds a function to get the current HelmState Co-authored-by: Raphael Luba <raphael@leanbyte.com> Signed-off-by: Niklas Ott <niklas.ott@unwired.at> * feat: return an error instead of panicking on multiple calls on WithPreparedCharts Signed-off-by: Niklas Ott <niklas.ott@unwired.at> --------- Signed-off-by: Niklas Ott <niklas.ott@unwired.at> Co-authored-by: Raphael Luba <raphael@leanbyte.com>
This commit is contained in:
+10
-2
@@ -57,9 +57,9 @@ func (r *Run) prepareChartsIfNeeded(helmfileCommand string, dir string, concurre
|
||||
return releaseToChart, nil
|
||||
}
|
||||
|
||||
func (r *Run) withPreparedCharts(helmfileCommand string, opts state.ChartPrepareOptions, f func() []error) error {
|
||||
func (r *Run) WithPreparedCharts(helmfileCommand string, opts state.ChartPrepareOptions, f func() []error) error {
|
||||
if r.ReleaseToChart != nil {
|
||||
panic("Run.PrepareCharts can be called only once")
|
||||
return fmt.Errorf("Run.WithPreparedCharts can be called only once")
|
||||
}
|
||||
|
||||
// Check both CLI options and helmDefaults for skipping repos (issue #2296)
|
||||
@@ -238,3 +238,11 @@ func (r *Run) diff(triggerCleanupEvent bool, detailedExitCode bool, c DiffConfig
|
||||
|
||||
return &infoMsg, releasesToBeUpdated, releasesToBeDeleted, nil
|
||||
}
|
||||
|
||||
func (r *Run) State() *state.HelmState {
|
||||
return r.state
|
||||
}
|
||||
|
||||
func (r *Run) Helm() helmexec.Interface {
|
||||
return r.helm
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user