-
Notifications
You must be signed in to change notification settings - Fork 160
Closed
Labels
Description
Current behavior:
When running func deploy
or func build
inside a function directory without specifying a registry, the commands prompt for registry information and after doing ctrl + C it provides the error of registry required it should validate first rather than asking first for the registry , creating a confusing user experience:
rayyan@rayyan-seliya:/mnt/c/Users/RAYYAN/Desktop/func/myfunction$ func deploy
A registry for function images is required. For example, 'docker.io/tigerteam'.
? Registry for function images:
Error: registry required to build function, please set with `--registry` or the FUNC_REGISTRY environment variable
Proposed improvement:
Check if a function exists before prompting for any configuration and provide clear, educational guidance:
Error: registry required to build or deploy function, please set with `--registry` or the FUNC_REGISTRY environment variable
Try this:
func deploy --registry ghcr.io/myuser Deploy with registry
Or set the FUNC_REGISTRY environment variable:
export FUNC_REGISTRY=ghcr.io/myuser
func deploy
Common registries:
ghcr.io/myuser GitHub Container Registry
docker.io/myuser Docker Hub
quay.io/myuser Quay.io
For more options, run 'func deploy --help'
Error: registry required to build or deploy function, please set with `--registry` or the FUNC_REGISTRY environment variable
Try this:
func build --registry ghcr.io/myuser Build with registry
Or set the FUNC_REGISTRY environment variable:
export FUNC_REGISTRY=ghcr.io/myuser
func build
Common registries:
ghcr.io/myuser GitHub Container Registry
docker.io/myuser Docker Hub
quay.io/myuser Quay.io
Or specify full image name:
func build --image ghcr.io/myuser/myfunction:latest
For more options, run 'func build --help'
Solution:
Validate the missing registry error first before asking for a registry prompt !
Use a 2 layer approach as discused !
Expected Workflow:
According to the official documentation, building and deploying requires:
- Create a function with
func create --language <lang> <name>
- Navigate to the function directory (
cd <name>
) OR use--path
flag - Build with
func build
orfunc build --registry <registry>
- Deploy with
func deploy
orfunc deploy --registry <registry>
The improved error message guides users through this exact workflow.
User Impact:
- Current: Confusing prompts → manual cancellation → unclear error
- Improved: Immediate clear guidance → better onboarding experience