Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entrypoint image lookup: change auth order #620

Merged
merged 2 commits into from
Mar 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkg/reconciler/v1alpha1/taskrun/entrypoint/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,17 @@ func getRemoteImage(image string, kubeclient kubernetes.Interface, build *buildv
return nil, fmt.Errorf("Failed to parse image %s: %v", image, err)
}

// First try to get the image anonymously
// FIXME(vdemeester): once google.Keychain fails smoother, this could be removed
imjasonh marked this conversation as resolved.
Show resolved Hide resolved
// See https://gist.github.com/vdemeester/c397ffb3fd19b4cc2ba3243dc4db9f83 for the current errors
// with google.Keychain in case `gcloud` command isn't available in the cluster.'
if img, err := remote.Image(ref); err == nil {
// Calling ConfigFile to actually try to connect to the remote registry
if _, err := img.ConfigFile(); err == nil {
return img, nil
}
}

kc, err := k8schain.New(kubeclient, k8schain.Options{
Namespace: build.Namespace,
ServiceAccountName: build.Spec.ServiceAccountName,
Expand Down