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

exit with usage when need login to image registry #8225

Merged
merged 6 commits into from
May 21, 2020

Conversation

medyagh
Copy link
Member

@medyagh medyagh commented May 20, 2020

closes #8124

before this PR

if user needed logging into the regsitry, (in this case github packages) there would be
long error lines and crash

πŸ˜„  minikube v1.10.1 on Ubuntu 20.04
✨  Using the docker driver based on existing profile
πŸ‘  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
E0520 12:59:32.299496  159997 cache.go:129] Error downloading kic artifacts:  getting remote image: GET https://docker.pkg.github.com/v2/kubernetes/minikube/kicbase/manifests/v0.0.10: UNAUTHORIZED: GitHub Docker Registry needs login
🀷  docker "minikube" container is missing, will recreate.
E0520 12:59:32.526096  159997 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Template parsing error: template: :1:8: executing "" at <.State.Status>: map has no entry for key "State"
πŸ”₯  Creating docker container (CPUs=2, Memory=3900MB) ...
🀦  StartHost failed, but will try again: recreate: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube --name minikube --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube --volume minikube:/var --cpus=2 --memory=3900mb -e container=docker --expose 8443 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10: exit status 125
stdout:

stderr:
Unable to find image 'docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.10' locally
docker: Error response from daemon: Get https://docker.pkg.github.com/v2/kubernetes/minikube/kicbase/manifests/v0.0.10: no basic auth credentials.
See 'docker run --help'.

🀷  docker "minikube" container is missing, will recreate.
E0520 13:00:02.871907  159997 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Template parsing error: template: :1:8: executing "" at <.State.Status>: map has no entry for key "State"
...
...
...

After this PR: exit short and sweet and provide link to how to login to the fall back image repos

After this PR:

πŸ˜„  minikube v1.10.1 on Ubuntu 20.04
✨  Using the docker driver based on existing profile
πŸ‘  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
πŸ“Ά  Unfortunately, could not download the base image gcr.io/k8s-minikube/kicbase1:v0.0.10 
❗  In order to use the fall back image, you need to log in to the github packages registry
πŸ“˜  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

πŸ’‘  Please either authenticate the registry or use --base-image option to use a different registry.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 20, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 20, 2020
@medyagh medyagh changed the title exit with usage when need login to github exit with usage when need login to registry May 20, 2020
@medyagh medyagh changed the title exit with usage when need login to registry exit with usage when need login to image registry May 20, 2020
pkg/minikube/node/cache.go Outdated Show resolved Hide resolved
pkg/minikube/node/cache.go Outdated Show resolved Hide resolved
pkg/minikube/node/cache.go Outdated Show resolved Hide resolved
@medyagh
Copy link
Member Author

medyagh commented May 21, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 21, 2020
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [67.24548190099999 67.276089406 66.703793632]
Average time for minikube: 67.07512164633333

Times for Minikube (PR 8225): [68.21249204 69.615924894 66.408918407]
Average time for Minikube (PR 8225): 68.07911178033333

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 8225) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.1 on Debian   |  0.068398 |           0.074103 |
|                           9.11 |           |                    |
| * Using the kvm2 driver based  |  0.024930 |           0.025618 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.003758 |           0.004531 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 41.737140 |          40.894801 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.2 | 22.650165 |          24.666427 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.890794 |           1.464513 |
| components...                  |           |                    |
| * Enabled addons:              |  0.610434 |           0.864244 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.084404 |           0.078726 |
| configured to use "minikube"   |           |                    |
|                                |  0.005100 |           0.006149 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [27.229035018 28.597669058 28.736605453999996]
Average time for minikube: 28.18776984333333

Times for Minikube (PR 8225): [28.538387113 28.051964047 28.305918612000003]
Average time for Minikube (PR 8225): 28.298756590666667

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 8225) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.1 on Debian           |  0.078749 |           0.078074 |
|                                   9.11 |           |                    |
| * Using the docker driver              |  0.002967 |           0.004565 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.061665 |           0.062220 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  8.245534 |           8.404859 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.2         |  0.130200 |           0.129469 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.642729 |          18.177718 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  0.889672 |           1.255164 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.065735 |           0.112359 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.065312 |           0.067774 |
| configured to use "minikube"           |           |                    |
|                                        |  0.005208 |           0.006554 |
+----------------------------------------+-----------+--------------------+

@codecov-commenter
Copy link

Codecov Report

Merging #8225 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8225      +/-   ##
==========================================
- Coverage   34.52%   34.50%   -0.02%     
==========================================
  Files         147      147              
  Lines        9408     9412       +4     
==========================================
  Hits         3248     3248              
- Misses       5761     5765       +4     
  Partials      399      399              
Impacted Files Coverage Ξ”
cmd/minikube/cmd/node_delete.go 13.33% <0.00%> (-4.85%) ⬇️

@medyagh
Copy link
Member Author

medyagh commented May 21, 2020

/retest-this-please

@medyagh medyagh merged commit 25045cf into kubernetes:master May 21, 2020
@afbjorklund
Copy link
Collaborator

It will still fail, though. Just with a different error message.

It would be better to use a more public image mirror....

@t5w0rd
Copy link

t5w0rd commented Jun 2, 2020

still fail.

$ docker login https://docker.pkg.github.com                                                                                                                 1 
Username (xxxxx): 
Password: 
Login Succeeded

$ minikube start --driver=docker
* minikube v1.11.0 on Centos 7.6.1810
* Using the docker driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
* Unfortunately, could not download the base image gcr.io/k8s-minikube/kicbase:v0.0.10 
! In order to use the fall back image, you need to log in to the github packages registry
* 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

* Please either authenticate to the registry or use --base-image flag to use a different registry.

@medyagh medyagh deleted the gh_package_login branch March 2, 2021 21:32
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unauthorized: Your request could not be authenticated by the GitHub Packages service
7 participants