Skip to content

Commit

Permalink
Normalize image name
Browse files Browse the repository at this point in the history
Provide consistency with how image names in function deployments
are normalized.

Signed-off-by: Han Verstraete <[email protected]>
  • Loading branch information
welteki authored and alexellis committed Apr 20, 2022
1 parent a574a0c commit e668bee
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/oci"
gocni "github.com/containerd/go-cni"
"github.com/docker/distribution/reference"
"github.com/openfaas/faasd/pkg/cninetwork"
"github.com/openfaas/faasd/pkg/service"
"github.com/pkg/errors"
Expand Down Expand Up @@ -107,7 +108,14 @@ func (s *Supervisor) Start(svcs []Service) error {
for _, svc := range svcs {
fmt.Printf("Preparing %s with image: %s\n", svc.Name, svc.Image)

img, err := service.PrepareImage(ctx, s.client, svc.Image, defaultSnapshotter, faasServicesPullAlways)
r, err := reference.ParseNormalizedNamed(svc.Image)
if err != nil {
return err
}

imgRef := reference.TagNameOnly(r).String()

img, err := service.PrepareImage(ctx, s.client, imgRef, defaultSnapshotter, faasServicesPullAlways)
if err != nil {
return err
}
Expand Down

0 comments on commit e668bee

Please sign in to comment.