boson-project / functions

A directory of information and resources for the Boson Project.
Apache License 2.0
6 stars 5 forks source link

[bug] kn faas deploy tried to push the images to dockerhub even though registry was mentioned as quay.io #23

Open nainaz opened 3 years ago

nainaz commented 3 years ago

Describe the bug After creating the the image for the Quarkus Function accepting events. kn faas deploy fails with the error message :

. exit status 1

To Reproduce Steps to reproduce the behavior:

  1. kn faas init -l quarkus
  2. kn faas build -v -c
  3. kn faas deploy -v -c
  4. provide registry as quay.io/username

Expected behavior image should get pushed to quay.io

Screenshots

kn faas deploy -v -c
Registry for Function images: quay.io/nainaz
Namespace: nsingh
Project path (/Users/naisingh/Documents/WorkSpaces/myfunctions/testdayquarkfunction): 
Building Function image:
Function image has been built, image: testdayquarkfunction
Pushing Function image to the registry:
/usr/local/bin/docker push testdayquarkfunction
The push refers to repository [docker.io/library/testdayquarkfunction]
83d85471d9f8: Preparing
82f9fb5c1cd2: Preparing
7cffc3c153c7: Preparing
7fc93d7f95e3: Preparing
adc9757997eb: Preparing
7c950d2655da: Preparing
6a2336482104: Preparing
46a41efcbd18: Preparing
97bd060e42f4: Preparing
3485805ce47c: Preparing
b0e2911c99f3: Preparing
7c950d2655da: Waiting
6a2336482104: Waiting
46a41efcbd18: Waiting
b0e2911c99f3: Waiting
3485805ce47c: Waiting
97bd060e42f4: Waiting
Error: denied: requested access to the resource is denied
. exit status 1

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

matejvasek commented 3 years ago

@nainaz this shouldn't be Quarkus specific. You wrote you run build before, what repository did you use there? I think the bug is that when you enter incorrect registry in some step, the incorrect value is written to faas.yaml and the value in the file is then authoritative.

matejvasek commented 3 years ago

There is inconsistency deploy is prompting for registry whereas build is prompting for image. This should be unified. What should we do? @boson-project/core

lance commented 3 years ago

There is inconsistency deploy is prompting for registry whereas build is prompting for image.

I mentioned this in #24 but I don't recall a prompt during deploy.

lance commented 3 years ago

I mentioned this in #24 but I don't recall a prompt during deploy.

Well clearly my multi-tasking is getting the better of me. Both prompt if there is no image yet built. But they prompt for the same thing.

❯ faas deploy
A registry for Function images is required. For example, 'docker.io/tigerteam'.

Registry for Function images: docker.io/tigerteam^C⏎                                                                                              
~/demo/foo is 📦 1.0.0-SNAPSHOT via ☕ v11.0.8 took 31s 
❯ faas build
Building image: 
A registry for Function images is required. For example, 'docker.io/tigerteam'.

Registry for Function images: ^C⏎                                                                                                                 
matejvasek commented 3 years ago

@lance there are two kinds of prompt. One explicit by using the -c flag, the other one is invoked by absence of some value. If a value is absent they both ask for registry. But for the -c flag it's different.

matejvasek commented 3 years ago

With the -c flag you are asked for registry even it it's set, the thing is that the value you enter there is ignored and the value from faas.yaml is used anyway. I believe that's this bug.