Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
add "skipDepUpdate" config parameter to HelmRelease
Browse files Browse the repository at this point in the history
some helm charts (istio being an example) add helm charts into the
"charts" folder directly and do not need "helm dep up" to be called. In
fact doing so will cause an error since the requirements have already
been fulfilled.  While you can disable this feature system wide it is
much more useful to allow individual helm releases to specify this
behavior.  this commit adds a 'skipDepUpdate' attribute to the
HelmRelease crd that causes the dependency update step to be skipped for
that release.
  • Loading branch information
betmix-matt committed Feb 7, 2019
1 parent 1f8fe86 commit a57b3a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deploy-helm/flux-helm-release-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ spec:
format: int64
resetValues:
type: boolean
skipDepUpdate:
type: boolean
valueFileSecrets:
type: array
properties:
Expand Down
3 changes: 3 additions & 0 deletions integrations/apis/flux.weave.works/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ type HelmReleaseSpec struct {
// Reset values on helm upgrade
// +optional
ResetValues bool `json:"resetValues,omitempty"`
// Do not run 'dep' update (assume requirements.yaml is already fulfilled)
// +optional
SkipDepUpdate bool `json:"skipDepUpdate,omitempty"`
}

// GetTimeout returns the install or upgrade timeout (defaults to 300s)
Expand Down
2 changes: 1 addition & 1 deletion integrations/helm/chartsync/chartsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func (chs *ChartChangeSync) reconcileReleaseDef(fhr fluxv1beta1.HelmRelease) {
chs.setCondition(&fhr, fluxv1beta1.HelmReleaseChartFetched, v1.ConditionTrue, ReasonCloned, "successfully cloned git repo")
chartPath = filepath.Join(chartClone.export.Dir(), chartSource.Path)

if chs.config.UpdateDeps {
if chs.config.UpdateDeps && !fhr.Spec.SkipDepUpdate {
if err := updateDependencies(chartPath, ""); err != nil {
chs.setCondition(&fhr, fluxv1beta1.HelmReleaseReleased, v1.ConditionFalse, ReasonDependencyFailed, err.Error())
chs.logger.Log("warning", "Failed to update chart dependencies", "namespace", fhr.Namespace, "name", fhr.Name, "error", err)
Expand Down

2 comments on commit a57b3a4

@liamfoneill
Copy link

Choose a reason for hiding this comment

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

Are you sure this works? I have tried passing 'skipDepUpdate: false' for Istio and I still get the error

@liamfoneill
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.