Skip to content

Commit

Permalink
Remove redundant argument
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <[email protected]>
  • Loading branch information
dgageot committed Dec 27, 2018
1 parent ee22429 commit abfecc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/skaffold/build/kaniko/kaniko.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (b *Builder) Build(ctx context.Context, out io.Writer, tagger tag.Tagger, a
}

func (b *Builder) buildArtifactWithKaniko(ctx context.Context, out io.Writer, tagger tag.Tagger, artifact *latest.Artifact) (string, error) {
initialTag, err := b.run(ctx, out, artifact, b.KanikoBuild)
initialTag, err := b.run(ctx, out, artifact)
if err != nil {
return "", errors.Wrapf(err, "kaniko build for [%s]", artifact.ImageName)
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/skaffold/build/kaniko/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func (b *Builder) run(ctx context.Context, out io.Writer, artifact *latest.Artifact, cfg *latest.KanikoBuild) (string, error) {
func (b *Builder) run(ctx context.Context, out io.Writer, artifact *latest.Artifact) (string, error) {
initialTag := util.RandomID()

s := sources.Retrieve(cfg)
s := sources.Retrieve(b.KanikoBuild)
context, err := s.Setup(ctx, out, artifact, initialTag)
if err != nil {
return "", errors.Wrap(err, "setting up build context")
Expand All @@ -52,17 +52,17 @@ func (b *Builder) run(ctx context.Context, out io.Writer, artifact *latest.Artif
fmt.Sprintf("--context=%s", context),
fmt.Sprintf("--destination=%s", imageDst),
fmt.Sprintf("-v=%s", logLevel().String())}
args = append(args, cfg.AdditionalFlags...)
args = append(args, b.AdditionalFlags...)
args = append(args, docker.GetBuildArgs(artifact.DockerArtifact)...)

if cfg.Cache != nil {
if b.Cache != nil {
args = append(args, "--cache=true")
if cfg.Cache.Repo != "" {
args = append(args, fmt.Sprintf("--cache-repo=%s", cfg.Cache.Repo))
if b.Cache.Repo != "" {
args = append(args, fmt.Sprintf("--cache-repo=%s", b.Cache.Repo))
}
}

pods := client.CoreV1().Pods(cfg.Namespace)
pods := client.CoreV1().Pods(b.Namespace)
p, err := pods.Create(s.Pod(args))
if err != nil {
return "", errors.Wrap(err, "creating kaniko pod")
Expand Down

0 comments on commit abfecc7

Please sign in to comment.