Skip to content

Commit

Permalink
Check for remote image config if image not present locally
Browse files Browse the repository at this point in the history
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
  • Loading branch information
corneliusweig committed May 23, 2019
1 parent ad8ded4 commit a4e8318
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions pkg/skaffold/build/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,5 @@ func (b *Builder) SyncMap(ctx context.Context, a *latest.Artifact) (map[string][
return nil, build.ErrSyncMapNotSupported{}
}

syncMap, err := docker.SyncMap(ctx, a.Workspace, a.DockerArtifact.DockerfilePath, a.DockerArtifact.BuildArgs, b.insecureRegistries)
if err != nil {
return nil, err
}

return syncMap, nil
return docker.SyncMap(ctx, a.Workspace, a.DockerArtifact.DockerfilePath, a.DockerArtifact.BuildArgs, b.insecureRegistries)
}
5 changes: 3 additions & 2 deletions pkg/skaffold/docker/image_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,12 @@ func RetrieveWorkingDir(tagged string, insecureRegistries map[string]bool) (stri
}

localDocker, err := NewAPIClient(false, nil)
if err == nil {
cf, err = localDocker.ConfigFile(context.Background(), tagged)
}
if err != nil {
// No local Docker is available
cf, err = RetrieveRemoteConfig(tagged, insecureRegistries)
} else {
cf, err = localDocker.ConfigFile(context.Background(), tagged)
}
if err != nil {
return "", errors.Wrap(err, "retrieving image config")
Expand Down

0 comments on commit a4e8318

Please sign in to comment.