Skip to content

Commit

Permalink
making pull secret optional
Browse files Browse the repository at this point in the history
  • Loading branch information
prary committed Jun 23, 2019
1 parent 1910736 commit 10e3a55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/skaffold/build/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ import (

// Build builds a list of artifacts with Kaniko.
func (b *Builder) Build(ctx context.Context, out io.Writer, tags tag.ImageTags, artifacts []*latest.Artifact) ([]build.Artifact, error) {
if b.PullSecret != "" {
teardownPullSecret, err := b.setupPullSecret(out)
if err != nil {
return nil, errors.Wrap(err, "setting up pull secret")
}
defer teardownPullSecret()

teardownPullSecret, err := b.setupPullSecret(out)
if err != nil {
return nil, errors.Wrap(err, "setting up pull secret")
}
defer teardownPullSecret()

if b.DockerConfig != nil {
teardownDockerConfigSecret, err := b.setupDockerConfigSecret(out)
Expand Down
3 changes: 3 additions & 0 deletions pkg/skaffold/build/cluster/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import (
)

func (b *Builder) setupPullSecret(out io.Writer) (func(), error) {
if b.PullSecret == "" {
return func() {}, nil
}
color.Default.Fprintf(out, "Creating kaniko secret [%s]...\n", b.PullSecretName)

client, err := kubernetes.GetClientset()
Expand Down

0 comments on commit 10e3a55

Please sign in to comment.