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

fix: improve error message for missing registry name #1510

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

lance
Copy link
Member

@lance lance commented Jan 19, 2023

When a user attempts to build, run or deploy a function and it has not been previously built, the --registry flag or FUNC_REGISTRY environment variable must be set so that the image name can be calculated. The current error message, registry required is not very helpful, and requires the user to divine what needs to happen next to fix the problem. This change updates the error message text to indicate that the user should set the --registry flag or FUNC_REGISTRY environment variable.

New behavior (https://app.warp.dev/block/YhpjkGod6HI8r2FbaBTeWz):

FUNC_REGISTRY='' ./func run -p viewer
   Building function image
Error: registry required to build function, please set with `--registry` or the FUNC_REGISTRY environment variable

Fixes: #1504

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

/kind enhancement

When a user attempts to build, run or deploy a function and it has not
been previously built, the `--registry` flag or `FUNC_REGISTRY` environment
variable must be set so that the image name can be calculated. The
current error message, `registry required` is not very helpful, and
requires the user to divine what needs to happen next to fix the
problem. This change updates the error message text to indicate that the
user should set the `--registry` flag or `FUNC_REGISTRY` environment
variable.

Fixes: knative#1504

Signed-off-by: Lance Ball <lball@redhat.com>
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 19, 2023
@lance lance added this to the 1.9.0 Release milestone Jan 19, 2023
@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Base: 54.90% // Head: 63.32% // Increases project coverage by +8.42% 🎉

Coverage data is based on head (7cda849) compared to base (d3d3233).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1510      +/-   ##
==========================================
+ Coverage   54.90%   63.32%   +8.42%     
==========================================
  Files          72       75       +3     
  Lines       10597    10770     +173     
==========================================
+ Hits         5818     6820    +1002     
+ Misses       4352     3394     -958     
- Partials      427      556     +129     
Flag Coverage Δ
integration-tests 53.20% <ø> (?)
unit-tests ?
unit-tests-macos-latest 53.26% <ø> (?)
unit-tests-ubuntu-latest 54.69% <ø> (?)
unit-tests-windows-latest 53.31% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
client.go 62.57% <ø> (+0.61%) ⬆️
cmd/create.go 46.82% <0.00%> (-5.55%) ⬇️
docker/docker_client_nonlinux.go 0.00% <0.00%> (ø)
openshift/openshift.go 5.40% <0.00%> (ø)
openshift/metadata.go 0.00% <0.00%> (ø)
docker/creds/credentials.go 73.06% <0.00%> (+1.34%) ⬆️
k8s/secrets.go 16.49% <0.00%> (+3.09%) ⬆️
k8s/configmaps.go 50.00% <0.00%> (+15.78%) ⬆️
k8s/client.go 88.46% <0.00%> (+23.07%) ⬆️
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@lkingland lkingland left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow
Copy link

knative-prow bot commented Jan 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance, lkingland

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

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2023
@knative-prow knative-prow bot merged commit 2b1ab1b into knative:main Jan 20, 2023
lance added a commit to lance/func that referenced this pull request Feb 15, 2023
When a user attempts to build, run or deploy a function and it has not
been previously built, the `--registry` flag or `FUNC_REGISTRY` environment
variable must be set so that the image name can be calculated. The
current error message, `registry required` is not very helpful, and
requires the user to divine what needs to happen next to fix the
problem. This change updates the error message text to indicate that the
user should set the `--registry` flag or `FUNC_REGISTRY` environment
variable.

Fixes: knative#1504

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
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Cryptic error message: registry is required
2 participants