Skip to content

Commit

Permalink
Added concurrency flag to helm deploy config
Browse files Browse the repository at this point in the history
Signed-off-by: Suleiman Dibirov <[email protected]>
  • Loading branch information
idsulik committed Sep 6, 2024
1 parent 842e94c commit 6900709
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/skaffold/deploy/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func (h *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Art
nsMap := map[string]struct{}{}
manifests := manifest.ManifestList{}
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(*h.Concurrency)
var mu sync2.Mutex

// Deploy every release
Expand Down
12 changes: 12 additions & 0 deletions pkg/skaffold/schema/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func Set(c *latest.SkaffoldConfig) error {
defaultToLocalBuild(c)
setDefaultTagger(c)
setDefaultLogsConfig(c)
setHelmDefaults(c)

for _, a := range c.Build.Artifacts {
setDefaultWorkspace(a)
Expand Down Expand Up @@ -113,6 +114,17 @@ func Set(c *latest.SkaffoldConfig) error {
return nil
}

func setHelmDefaults(c *latest.SkaffoldConfig) {
if c.Deploy.LegacyHelmDeploy == nil {
return
}

if c.Deploy.LegacyHelmDeploy.Concurrency == nil {
defaultConcurrency := 1
c.Deploy.LegacyHelmDeploy.Concurrency = &defaultConcurrency
}
}

// SetDefaultRenderer sets the default manifests to rawYaml.
func SetDefaultRenderer(c *latest.SkaffoldConfig) {
if len(c.Render.Generate.Kpt) > 0 {
Expand Down
4 changes: 4 additions & 0 deletions pkg/skaffold/schema/latest/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,10 @@ type KubectlFlags struct {

// LegacyHelmDeploy *beta* uses the `helm` CLI to apply the charts to the cluster.
type LegacyHelmDeploy struct {
// Concurrency is how many packages can be installed concurrently. 0 means "no-limit".
// Defaults to `1`.
Concurrency *int `yaml:"concurrency,omitempty"`

// Releases is a list of Helm releases.
Releases []HelmRelease `yaml:"releases,omitempty"`

Expand Down

0 comments on commit 6900709

Please sign in to comment.