Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set helm extra args early #1411

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ func (a *App) getSelectedReleases(r *Run) ([]state.ReleaseSpec, error) {
func (a *App) apply(r *Run, c ApplyConfigProvider) (bool, bool, []error) {
st := r.state
helm := r.helm
helm.SetExtraArgs(argparser.GetArgs(c.Args(), st)...)

allReleases := st.GetReleasesWithOverrides()

Expand Down Expand Up @@ -1139,8 +1140,6 @@ Do you really want to apply?
st.Releases = allReleases

if !interactive || interactive && r.askForConfirmation(confMsg) {
r.helm.SetExtraArgs(argparser.GetArgs(c.Args(), r.state)...)

// We deleted releases by traversing the DAG in reverse order
if len(releasesToBeDeleted) > 0 {
_, deletionErrs := withDAG(st, helm, a.Logger, true, a.Wrap(func(subst *state.HelmState, helm helmexec.Interface) []error {
Expand Down Expand Up @@ -1195,6 +1194,7 @@ Do you really want to apply?
func (a *App) delete(r *Run, purge bool, c DestroyConfigProvider) (bool, []error) {
st := r.state
helm := r.helm
helm.SetExtraArgs(argparser.GetArgs(c.Args(), st)...)

affectedReleases := state.AffectedReleases{}

Expand Down Expand Up @@ -1249,8 +1249,6 @@ Do you really want to delete?
`, strings.Join(names, "\n"))
interactive := c.Interactive()
if !interactive || interactive && r.askForConfirmation(msg) {
r.helm.SetExtraArgs(argparser.GetArgs(c.Args(), r.state)...)

if len(releasesToDelete) > 0 {
_, deletionErrs := withDAG(st, helm, a.Logger, true, a.Wrap(func(subst *state.HelmState, helm helmexec.Interface) []error {
var rs []state.ReleaseSpec
Expand Down Expand Up @@ -1278,6 +1276,7 @@ Do you really want to delete?
func (a *App) sync(r *Run, c SyncConfigProvider) (bool, []error) {
st := r.state
helm := r.helm
helm.SetExtraArgs(argparser.GetArgs(c.Args(), st)...)

allReleases := st.GetReleasesWithOverrides()

Expand Down Expand Up @@ -1352,8 +1351,6 @@ func (a *App) sync(r *Run, c SyncConfigProvider) (bool, []error) {

var errs []error

r.helm.SetExtraArgs(argparser.GetArgs(c.Args(), r.state)...)

// Traverse DAG of all the releases so that we don't suffer from false-positive missing dependencies
st.Releases = allReleases

Expand Down