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

wip: Exit out when failed to download kic image and fallback images. #11589

Conversation

vishjain
Copy link
Contributor

@vishjain vishjain commented Jun 7, 2021

fixes #8997

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 7, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vishjain
To complete the pull request process, please assign afbjorklund after the PR has been reviewed.
You can assign the PR to them by writing /assign @afbjorklund in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

Hi @vishjain. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 7, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 7, 2021
@@ -173,7 +173,9 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down
return nil
}
}
klog.Infof("failed to download %s, will try fallback image if available: %v", img, err)
infoStr := fmt.Sprintf("failed to download %s, will try fallback image if available: %v", img, err)
image.ErrFailedDownloadKICImages = errors.New(infoStr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, global Err* variables are supposed to be read-only, excluding maybe init functions. The idea is to be able to have checks like if err == image.ErrFailedDownloadKICImages { ... . Changing value of Err* makes such checks undetermined and hard to debug.

Copy link
Contributor

@ilya-zuyev ilya-zuyev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add PR description attaching minikube logs before and after the changes?

@@ -21,3 +21,6 @@ var ErrNeedsLogin error

// ErrGithubNeedsLogin is thrown when user needs to login specifically to github packages)
var ErrGithubNeedsLogin error

// ErrFailedDownloadKICImages is thrown when user
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you finish this comment?

@vishjain vishjain closed this Jun 9, 2021
@vishjain vishjain reopened this Jun 9, 2021
@@ -193,6 +195,8 @@ func waitDownloadKicBaseImage(g *errgroup.Group) {
}
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 if errors.Is(err, image.ErrFailedDownloadKICImages) {
exit.Message(reason.Usage, "Failed to download KIC base image or any fallback image.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a "Usage" problem !

@medyagh medyagh changed the title Exit out when failed to download kic image and fallback images. wip: Exit out when failed to download kic image and fallback images. Jun 18, 2021
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 18, 2021
@medyagh
Copy link
Member

medyagh commented Jun 18, 2021

@vishjain still working on this ?

@vishjain
Copy link
Contributor Author

@medyagh Making changes, Thanks!

@vishjain vishjain closed this Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed to download kic base image or any fallback image (unable to access gcr.io)
6 participants