Skip to content

skaffold is not fully compatible with google artifact registry and container registry URLs #4878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yuwenma opened this issue Oct 8, 2020 · 2 comments
Labels
area/registry kind/bug Something isn't working priority/p2 May take a couple of releases

Comments

@yuwenma
Copy link
Contributor

yuwenma commented Oct 8, 2020

Skaffold uses an external library to parse the app image. This library could not recognize google artifact registry and container registry images if both tag and digest are given.

Information

  • Skaffold version: v1.14

Steps to reproduce the behavior

run the following code, the parsing fails with error ”unsupported digest algorithm”.

package main
 
import (
    "fmt"
	"github.com/docker/distribution/reference"
)
 
func main() {
    r, err := reference.Parse("us-central1-docker.pkg.dev/yuwenma-gke-playground/app/app@sha256:06dd9251e79f06254ec0557945ddb2d7eac5ded1d1c37d4860a24e350a983c52")
	if err != nil {
		fmt.Printf("%v", err)
	}
	if n, ok := r.(reference.Named); ok {
	    fmt.Printf("Image %v\n", n)
	}
	
	if n, ok := r.(reference.Tagged); ok {
	    fmt.Printf("Tag %v\n", n)
	}
 
	if n, ok := r.(reference.Digested); ok {
	    fmt.Printf("Digest %v\n", n)
	}
 
}
@yuwenma yuwenma added the kind/bug Something isn't working label Oct 8, 2020
@yuwenma yuwenma added this to the Backlog [P0/P1] milestone Oct 8, 2020
@briandealwis
Copy link
Member

I suspect we should use go-containerregistry's go-containerregistry/pkg/name.ParseReference().

@gsquared94 gsquared94 added the priority/p2 May take a couple of releases label Oct 12, 2020
@briandealwis
Copy link
Member

Closing as should be fixed with #5053. At least your sample code seems to work fine with pkg/skaffold/docker/ParseReference:

package main
 
import (
    "fmt"
    "github.com/GoogleContainerTools/skaffold/pkg/skaffold/docker"
)
 
func main() {
    r, err := docker.ParseReference("us-central1-docker.pkg.dev/yuwenma-gke-playground/app/app@sha256:06dd9251e79f06254ec0557945ddb2d7eac5ded1d1c37d4860a24e350a983c52")
    if err != nil {
	    fmt.Printf("%v", err)
    }
    fmt.Printf("Image %#v\n", r)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry kind/bug Something isn't working priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

3 participants