Skip to content

func build/deploy prompts for registry before validation - confusing UX #3057

@RayyanSeliya

Description

@RayyanSeliya

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:

  1. Create a function with func create --language <lang> <name>
  2. Navigate to the function directory (cd <name>) OR use --path flag
  3. Build with func build or func build --registry <registry>
  4. Deploy with func deploy or func 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions