diff --git a/pkg/action/upgrade.go b/pkg/action/upgrade.go index b0f294cae..50397bd5c 100644 --- a/pkg/action/upgrade.go +++ b/pkg/action/upgrade.go @@ -21,6 +21,7 @@ import ( "context" "fmt" "strings" + "sync" "time" "github.com/pkg/errors" @@ -98,12 +99,15 @@ type Upgrade struct { PostRenderer postrender.PostRenderer // DisableOpenAPIValidation controls whether OpenAPI validation is enforced. DisableOpenAPIValidation bool + // Synchronize multiple upgrade operations happening in parallel + Mutex *sync.Mutex } // NewUpgrade creates a new Upgrade object with the given configuration. func NewUpgrade(cfg *Configuration) *Upgrade { return &Upgrade{ - cfg: cfg, + cfg: cfg, + Mutex: &sync.Mutex{}, } } @@ -126,7 +130,9 @@ func (u *Upgrade) Run(name string, chart *chart.Chart, vals map[string]interface return nil, err } + u.Mutex.Lock() u.cfg.Releases.MaxHistory = u.MaxHistory + u.Mutex.Unlock() u.cfg.Log("performing update for %s", name) res, err := u.performUpgrade(currentRelease, upgradedRelease) diff --git a/pkg/chartutil/validate_name.go b/pkg/chartutil/validate_name.go index 913a477cf..a2dcd432c 100644 --- a/pkg/chartutil/validate_name.go +++ b/pkg/chartutil/validate_name.go @@ -61,7 +61,7 @@ const ( // ValidateReleaseName performs checks for an entry for a Helm release name // // For Helm to allow a name, it must be below a certain character count (53) and also match -// a reguar expression. +// a regular expression. // // According to the Kubernetes help text, the regular expression it uses is: //