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

Remove duplicated error check #20212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
24 changes: 11 additions & 13 deletions pkg/minikube/node/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,20 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down
// waitDownloadKicBaseImage blocks until the base image for KIC is downloaded.
func waitDownloadKicBaseImage(g *errgroup.Group) {
if err := g.Wait(); err != nil {
if err != nil {
if errors.Is(err, image.ErrGithubNeedsLogin) {
klog.Warningf("Error downloading kic artifacts: %v", err)
out.ErrT(style.Connectivity, "Unfortunately, could not download the base image {{.image_name}} ", out.V{"image_name": image.Tag(kic.BaseImage)})
out.WarningT("In order to use the fall back image, you need to log in to the github packages registry")
out.Styled(style.Documentation, `Please visit the following link for documentation around this:
if errors.Is(err, image.ErrGithubNeedsLogin) {
klog.Warningf("Error downloading kic artifacts: %v", err)
out.ErrT(style.Connectivity, "Unfortunately, could not download the base image {{.image_name}} ", out.V{"image_name": image.Tag(kic.BaseImage)})
out.WarningT("In order to use the fall back image, you need to log in to the github packages registry")
out.Styled(style.Documentation, `Please visit the following link for documentation around this:
https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages
`)
}
if errors.Is(err, image.ErrGithubNeedsLogin) || errors.Is(err, image.ErrNeedsLogin) {
exit.Message(reason.Usage, `Please either authenticate to the registry or use --base-image flag to use a different registry.`)
} else {
klog.Errorln("Error downloading kic artifacts: ", err)
}

}
if errors.Is(err, image.ErrGithubNeedsLogin) || errors.Is(err, image.ErrNeedsLogin) {
exit.Message(reason.Usage, `Please either authenticate to the registry or use --base-image flag to use a different registry.`)
} else {
klog.Errorln("Error downloading kic artifacts: ", err)
}

}
klog.Info("Successfully downloaded all kic artifacts")
}
Expand Down