kubernetes-retired/frakti

Image pull is fail for hyper runtime

resouer opened this issue · 2 comments

Events:
  Type     Reason                 Age               From               Message
  ----     ------                 ----              ----               -------
  Normal   Scheduled              3m                default-scheduler  Successfully assigned echo-cb8695578-ns9n9 to only
  Normal   SuccessfulMountVolume  3m                kubelet, only      MountVolume.SetUp succeeded for volume "default-token-p6l9c"
  Normal   Pulling                2m (x4 over 3m)   kubelet, only      pulling image "alexellis/faas-nodejs-echo"
  Warning  Failed                 2m (x4 over 3m)   kubelet, only      Failed to pull image "alexellis/faas-nodejs-echo": rpc error: code = Unknown desc = PullImage from hyper image service failed: image "docker.io/alexellis/faas-nodejs-echo" with tag "latest" not found
  Warning  FailedSync             1m (x10 over 3m)  kubelet, only      Error syncing pod
  Normal   BackOff                1m (x6 over 3m)   kubelet, only      Back-off pulling image "alexellis/faas-nodejs-echo"

Even though the image is definitely valid. Maybe related to the change in docker to deal with lib path.

A quick fix:

diff --git a/pkg/hyper/client.go b/pkg/hyper/client.go
index 34c0933..7641d4e 100644
--- a/pkg/hyper/client.go
+++ b/pkg/hyper/client.go
@@ -284,9 +284,12 @@ func (c *Client) GetImageInfo(image, tag string) (*types.ImageInfo, error) {
 
        // change `docker.io/library/imageName` to `imageName`
        if split := strings.Split(image, "/"); len(split) == 3 &&
-               split[0] == defaultDomain &&
-               split[1] == officialRepoName {
-               image = split[2]
+               split[0] == defaultDomain {
+                if split[1] == officialRepoName  {
+                       image = split[2]
+               } else {
+                       image = split[1] + "/" + split[2]
+               }
        }
 
        fullImageName := fmt.Sprintf("%s%s%s", image, repoSep, tag)

closed by #254