Skip to content

Commit

Permalink
Merge pull request #877 from dgageot/kubectl-no-change
Browse files Browse the repository at this point in the history
Do not run kubectl if nothing has changed
  • Loading branch information
dgageot authored Aug 6, 2018
2 parents 7848180 + 5436ec7 commit 04ace7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/skaffold/deploy/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (k *KubectlDeployer) Deploy(ctx context.Context, out io.Writer, builds []bu
}

if manifests.Empty() {
return []Artifact{}, nil
return nil, nil
}

manifests, err = manifests.replaceImages(builds)
Expand All @@ -85,6 +85,9 @@ func (k *KubectlDeployer) Deploy(ctx context.Context, out io.Writer, builds []bu
updated := k.previousDeployment.diff(manifests)
logrus.Debugln(len(manifests), "manifests to deploy.", len(manifests), "are updated or new")
k.previousDeployment = manifests
if len(updated) == 0 {
return nil, nil
}

err = kubectl(updated.reader(), out, k.kubeContext, k.Flags.Global, "apply", k.Flags.Apply, "-f", "-")
if err != nil {
Expand Down

0 comments on commit 04ace7a

Please sign in to comment.