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

cache add: improved error message when image does not exist #10811

Conversation

tripolkaandrey
Copy link
Contributor

@tripolkaandrey tripolkaandrey commented Mar 13, 2021

Fixes #9217
Improved error message by adding message suggested by @Evalle in the corresponding issue.

Before

PS C:\Users\jenkins> minikube cache add doesnt_exist_thing:haha
E0910 18:30:13.540553    3980 cache.go:63] save image to file "doesnt_exist_thing:haha" -> "C:\\Users\\jenkins\\.minikube\\cache\\images\\doesnt_exist_thing_haha" failed: nil image for doesnt_exist_thing:haha: GET https://index.docker.io/v2/library/doesnt_exist_thing/manifests/haha: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/doesnt_exist_thing Type:repository]]

X Exiting due to MK_CACHE_LOAD: save to dir: caching images: caching image "C:\\Users\\jenkins\\.minikube\\cache\\images\\doesnt_exist_thing_haha": nil image for doesnt_exist_thing:haha: GET https://index.docker.io/v2/library/doesnt_exist_thing/manifests/haha: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/doesnt_exist_thing Type:repository]]
*
* If the above advice does not help, please let us know:
  - https://github.com/kubernetes/minikube/issues/new/choose

After

❗  "minikube cache" will be deprecated in upcoming versions, please switch to "minikube image load"
❗  The image you are trying to add ubuntu doesn't exist!

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

Hi @tripolkaandrey. 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 Mar 13, 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 Mar 13, 2021
pkg/minikube/image/cache.go Outdated Show resolved Hide resolved
@tripolkaandrey tripolkaandrey force-pushed the improve/cache-add-not-existing-image-error-message branch from 011609b to f63a7b3 Compare March 17, 2021 14:28
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 17, 2021
@tripolkaandrey
Copy link
Contributor Author

@medyagh please take a look

pkg/minikube/image/cache.go Outdated Show resolved Hide resolved
@medyagh
Copy link
Member

medyagh commented Mar 23, 2021

@tripolkaandrey please also update the PR description with the new UI before and after this PR

@tripolkaandrey tripolkaandrey force-pushed the improve/cache-add-not-existing-image-error-message branch from f63a7b3 to b7976f6 Compare March 23, 2021 09:05
@tripolkaandrey
Copy link
Contributor Author

tripolkaandrey commented Mar 23, 2021

@medyagh I have updated PR description. What do you think about taking the image name in parentheses and rephrasing error message like that:

❗  The image (ubuntu) you are trying to add doesn't exist!

@medyagh
Copy link
Member

medyagh commented Mar 23, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 23, 2021
@kubernetes kubernetes deleted a comment from minikube-pr-bot Mar 23, 2021
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: 72.2s 68.1s 71.8s
Average time for minikube: 70.7s

Times for Minikube (PR 10811): 66.9s 71.8s 68.3s
Average time for Minikube (PR 10811): 69.0s

Averages Time Per Log

+--------------------------------------------+----------+---------------------+
|                    LOG                     | MINIKUBE | MINIKUBE (PR 10811) |
+--------------------------------------------+----------+---------------------+
| * minikube v1.18.1 on Debian               | 0.1s     | 0.1s                |
| 9.11 (kvm/amd64)                           |          |                     |
| * Using the kvm2 driver based              | 0.0s     | 0.0s                |
| on user configuration                      |          |                     |
| * Starting control plane node              | 0.0s     | 0.0s                |
| minikube in cluster minikube               |          |                     |
| * Creating kvm2 VM (CPUs=2,                | 41.4s    | 41.5s               |
| Memory=3700MB, Disk=20000MB)               |          |                     |
| ...                                        |          |                     |
| * Preparing Kubernetes v1.20.2             | 17.4s    | 10.2s               |
| on Docker 20.10.4 ...                      |          |                     |
|   - Generating certificates                | 2.2s     | 3.0s                |
| and keys ...                               |          |                     |
|   - Booting up control plane               | 5.6s     | 10.4s               |
| ...                                        |          |                     |
|   - Configuring RBAC rules ...             | 1.1s     | 1.3s                |
| * Verifying Kubernetes                     | 0.1s     | 0.1s                |
| components...                              |          |                     |
|   - Using image                            | 1.6s     | 1.5s                |
| gcr.io/k8s-minikube/storage-provisioner:v4 |          |                     |
| * Enabled addons:                          | 1.3s     | 0.9s                |
| storage-provisioner,                       |          |                     |
| default-storageclass                       |          |                     |
| * Done! kubectl is now                     | 0.0s     | 0.0s                |
| configured to use "minikube"               |          |                     |
| cluster and "default"                      |          |                     |
| namespace by default                       |          |                     |
+--------------------------------------------+----------+---------------------+

docker Driver
Times for minikube: 31.1s 44.3s 41.7s
Average time for minikube: 39.0s

Times for Minikube (PR 10811): 36.1s 34.9s 39.2s
Average time for Minikube (PR 10811): 36.7s

Averages Time Per Log

+--------------------------------------------+----------+---------------------+
|                    LOG                     | MINIKUBE | MINIKUBE (PR 10811) |
+--------------------------------------------+----------+---------------------+
| * minikube v1.18.1 on Debian               | 0.2s     | 2.8s                |
| 9.11 (kvm/amd64)                           |          |                     |
| * Using the docker driver                  | 0.1s     | 1.3s                |
| based on user configuration                |          |                     |
| * Starting control plane node              | 0.1s     | 0.1s                |
| minikube in cluster minikube               |          |                     |
| * Creating docker container                | 17.3s    | 14.2s               |
| (CPUs=2, Memory=3700MB) ...                |          |                     |
| * Preparing Kubernetes v1.20.2             | 19.5s    | 16.9s               |
| on Docker 20.10.3 ...                      |          |                     |
| * Verifying Kubernetes                     | 0.1s     | 0.1s                |
| components...                              |          |                     |
|   - Using image                            | 1.7s     | 1.4s                |
| gcr.io/k8s-minikube/storage-provisioner:v4 |          |                     |
| * Enabled addons:                          | 0.1s     | 0.1s                |
| storage-provisioner,                       |          |                     |
| default-storageclass                       |          |                     |
| * Done! kubectl is now                     | 0.0s     | 0.0s                |
| configured to use "minikube"               |          |                     |
| cluster and "default"                      |          |                     |
| namespace by default                       |          |                     |
+--------------------------------------------+----------+---------------------+

@tripolkaandrey
Copy link
Contributor Author

tripolkaandrey commented Mar 24, 2021

@medyagh may you help please? I have read about the pr process and I guess this PR should be automatically merged after approve. Did I get something wrong? Also what do you think about my suggestion above?

@medyagh medyagh merged commit 4224612 into kubernetes:master Mar 25, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, tripolkaandrey

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

The pull request process is described 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. pr_verified size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"cache add" command: improve error message for not existing image.
5 participants