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

func build with -i does not use given image name #1125

Closed
gauron99 opened this issue Jul 19, 2022 · 4 comments · Fixed by #1204
Closed

func build with -i does not use given image name #1125

gauron99 opened this issue Jul 19, 2022 · 4 comments · Fixed by #1204
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@gauron99
Copy link
Contributor

Using func build -i docker.io/gauron/app:latest doesnt create image named docker.io/gauron/app:latest but instead
image-registry.openshift-image-registry.svc:5000/default/app (name gets overridden)

  • Reproduce:
    func create -l go
    func build -i docker.io/name/app

it looks to me like in Build function (client.go) the registry is populated with the openshift default registry and used in DerivedImage (look at image below)

image
f.Registry is empty but registry is the default openshift registry right before the if statement (as indicated by the LOOK DEEP print) therefore the if is skipped and image is built without image flag

/kind bug

@knative-prow knative-prow bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 19, 2022
@lance
Copy link
Member

lance commented Jul 19, 2022

Good catch!

@zroubalik
Copy link
Contributor

@gauron99 nice, are you eager to fix this one? 😄

@gauron99
Copy link
Contributor Author

@gauron99 nice, are you eager to fix this one? smile

i can give it a go :D
/assign

@lance
Copy link
Member

lance commented Aug 30, 2022

/assign

lance added a commit to lance/func that referenced this issue Aug 30, 2022
If the user provides an `--image` flag on the command line, it should be
used. This commit modifies the image resolving code to check whether or
not the image name was provided on the command line.

Fixes: knative#1125

Signed-off-by: Lance Ball <lball@redhat.com>
knative-prow bot pushed a commit that referenced this issue Aug 31, 2022
* fix: check for `--image` flag in build command

If the user provides an `--image` flag on the command line, it should be
used. This commit modifies the image resolving code to check whether or
not the image name was provided on the command line.

Fixes: #1125

Signed-off-by: Lance Ball <lball@redhat.com>

* fixup: review feedback

Signed-off-by: Lance Ball <lball@redhat.com>

Signed-off-by: Lance Ball <lball@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants