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

Bug: Wrong error message when running func commands if the function is not initialized #2280

Open
Leo6Leo opened this issue Apr 24, 2024 · 3 comments
Labels
kind/good-first-issue Denotes an issue ready for a new contributor.

Comments

@Leo6Leo
Copy link
Member

Leo6Leo commented Apr 24, 2024

Issue Summary:

When executing the commands func deploy, func run, and func build without first initializing a function (missing func.yaml file due to not running func create or func init), the error handling leads to an unclear message. This occurs even if the commands are typed correctly.

Current Behavior:

Attempting to run any of the above commands without initializing a function results in a misleading error message related to registry validation:

func build -b=s2i -v
A registry for function images is required. For example, 'docker.io/tigerteam'.
X Sorry, your reply was invalid: invalid registry ["quay.io/user-abc"]: name required
? Registry for function images:

The error message should clearly indicate that the function has not been initialized and provide guidance on the necessary steps to proceed.

Proposed Solution:

Improve the error message to more accurately reflect the issue and guide the user. Suggested new error message:

Error: No function has been initialized in the current directory ({path}). Please initialize a function by running either:
- func init --language <your language>
- func create <function name> --language <language>
@lkingland lkingland added the kind/good-first-issue Denotes an issue ready for a new contributor. label Apr 25, 2024
@lkingland
Copy link
Member

Thanks @Leo6Leo,

This does look like a logic problem. There should be a different error there.

I've added this to the roadmap

@EraKin575
Copy link

I would like to work on this issue!

@gauron99
Copy link
Contributor

@EraKin575 hello, are you still working on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/good-first-issue Denotes an issue ready for a new contributor.
Projects
Status: 🔖 Next
Development

No branches or pull requests

4 participants