knative/func

func deploy doesn't support registry port

Closed this issue · 1 comments

I try to run a knative function on a docker desktop k8s cluster.
For the registry, I use registry:2 on docker desktop with forwarded port to 5001:

$ docker ps | grep registry:2
04a2c59975c7   registry:2   "/entrypoint.sh /etc…"   18 minutes ago   Up 18 minutes   0.0.0.0:5001->5000/tcp   registry

Sample func:

specVersion: 0.36.0
name: demo
runtime: go
registry: registry.192.168.2.99.sslip.io:5001
image: registry.192.168.2.99.sslip.io:5001/demo:latest
created: 2024-08-02T10:48:42.077191+02:00
invoke: cloudevent
build:
  builder: host
  buildEnvs:
  - name: FUNC_ENABLE_HOST_BUILDER
    value: "true"
  - name: FUNC_BUILDER
    value: host
  - name: FUNC_CONTAINER
    value: "true"
  - name: LOG_LEVEL
    value: error
run:
  envs:
  - value: '{{ secret:demo }}'
deploy:
  namespace: cs
  image: registry.192.168.2.99.sslip.io:5001/demo:latest
  options:
    scale:
      min: 0
      max: 1
  subscriptions:
  - source: default
    filters:
      type: demo.event

The build of the function, even with image upload works as expected:

$ func build -u --registry-insecure
Building function image
   f.linux.amd64
go: module ./f requires go >= 1.22.4; switching to go1.22.7
go: upgraded go 1.21 => 1.22.4
go: added toolchain go1.22.7
go: upgraded github.com/rs/zerolog v1.32.0 => v1.33.0
go: upgraded golang.org/x/sys v0.18.0 => v0.22.0
   f.linux.arm64
   f.linux.arm.v7
🙌 Function built: registry.192.168.2.99.sslip.io:5001/demo:latest

$ curl -k registry.192.168.2.99.sslip.io:5001/v2/demo/tags/list
{"name":"demo","tags":["latest"]}

But the deployment command doesn't support image-names with a port in it:

$ func deploy -i registry.192.168.2.99.sslip.io:5001/demo:latest
Warning: namespace chosen is 'cs', but currently active namespace is 'default'. Continuing with deployment to 'cs'.
Error: image 'registry.192.168.2.99.sslip.io:5001/demo:latest' contains an invalid tag (extra ':')

Please fix that validation, so that local registries are allowed to test knative functions.

Thanks for posting the issue. This does indeed appear to be a bug. A fix should land shortly in main