Skip to content

Commit

Permalink
Remove duplication
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <[email protected]>
  • Loading branch information
dgageot committed Jul 19, 2018
1 parent 56c2cb8 commit 10a64d1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions pkg/skaffold/build/gcb/container_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ func (b *Builder) Build(ctx context.Context, out io.Writer, tagger tag.Tagger, a
}

func (b *Builder) buildArtifact(ctx context.Context, out io.Writer, tagger tag.Tagger, artifact *v1alpha2.Artifact) (string, error) {
fmt.Fprintf(out, "Building [%s]...\n", artifact.ImageName)

client, err := google.DefaultClient(ctx, cloudbuild.CloudPlatformScope)
if err != nil {
return "", errors.Wrap(err, "getting google client")
Expand Down
3 changes: 0 additions & 3 deletions pkg/skaffold/build/kaniko/kaniko.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package kaniko

import (
"context"
"fmt"
"io"

"github.com/GoogleContainerTools/skaffold/pkg/skaffold/build"
Expand All @@ -41,8 +40,6 @@ func (b *Builder) Build(ctx context.Context, out io.Writer, tagger tag.Tagger, a
}

func (b *Builder) buildArtifact(ctx context.Context, out io.Writer, tagger tag.Tagger, artifact *v1alpha2.Artifact) (string, error) {
fmt.Fprintf(out, "Building [%s]...\n", artifact.ImageName)

initialTag, err := runKaniko(ctx, out, artifact, b.KanikoBuild)
if err != nil {
return "", errors.Wrapf(err, "kaniko build for [%s]", artifact.ImageName)
Expand Down
2 changes: 2 additions & 0 deletions pkg/skaffold/build/parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func InParallel(ctx context.Context, out io.Writer, tagger tag.Tagger, artifacts
r, w := io.Pipe()

go func() {
fmt.Fprintf(w, "Building [%s]...\n", artifacts[i].ImageName)

tags[i], errs[i] = buildArtifact(ctx, w, tagger, artifacts[i])
w.Close()
}()
Expand Down

0 comments on commit 10a64d1

Please sign in to comment.