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

Add support for helm --force flag #1499

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion examples/annotated-skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ deploy:

# helm:
# helm releases to deploy.
# Uses "helm install" if not installed yet, otherwise "helm upgrade" is executed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, unfortunately because of the way we have to release config changes, this change also needs to be made in integration/examples/annotated-skaffold.yaml. Would you mind adding it there as well? Thanks!

# releases:
# - name: skaffold-helm
# chartPath: skaffold-helm
Expand All @@ -193,7 +194,11 @@ deploy:
# image: skaffold-helm
# namespace: skaffold
# version: ""
# recreatePods: false
# # use --recreate-pods for helm upgrade
# recreatePods: true
# wait: false
# # use --force for helm upgrade
# force: true
#
# # setValues get appended to the helm deploy with --set.
# setValues:
Expand Down
3 changes: 3 additions & 0 deletions pkg/skaffold/deploy/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func (h *HelmDeployer) deployRelease(ctx context.Context, out io.Writer, r lates
if r.RecreatePods {
args = append(args, "--recreate-pods")
}
if r.Force {
args = append(args, "--force")
}
}

// There are 2 strategies:
Expand Down
1 change: 1 addition & 0 deletions pkg/skaffold/schema/latest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ type HelmRelease struct {
SetValues map[string]string `yaml:"setValues,omitempty"`
SetValueTemplates map[string]string `yaml:"setValueTemplates,omitempty"`
Wait bool `yaml:"wait,omitempty"`
Force bool `yaml:"force,omitempty"`
RecreatePods bool `yaml:"recreatePods,omitempty"`
Overrides map[string]interface{} `yaml:"overrides,omitempty"`
Packaged *HelmPackaged `yaml:"packaged,omitempty"`
Expand Down