mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-08 16:06:47 +00:00
Normalize image name
Provide consistency with how image names in function deployments are normalized. Signed-off-by: Han Verstraete <welteki@pm.me>
This commit is contained in:
parent
a574a0c06f
commit
e668beef13
@ -19,6 +19,7 @@ import (
|
|||||||
"github.com/containerd/containerd/containers"
|
"github.com/containerd/containerd/containers"
|
||||||
"github.com/containerd/containerd/oci"
|
"github.com/containerd/containerd/oci"
|
||||||
gocni "github.com/containerd/go-cni"
|
gocni "github.com/containerd/go-cni"
|
||||||
|
"github.com/docker/distribution/reference"
|
||||||
"github.com/openfaas/faasd/pkg/cninetwork"
|
"github.com/openfaas/faasd/pkg/cninetwork"
|
||||||
"github.com/openfaas/faasd/pkg/service"
|
"github.com/openfaas/faasd/pkg/service"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@ -107,7 +108,14 @@ func (s *Supervisor) Start(svcs []Service) error {
|
|||||||
for _, svc := range svcs {
|
for _, svc := range svcs {
|
||||||
fmt.Printf("Preparing %s with image: %s\n", svc.Name, svc.Image)
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user