Skip to content

Parse() returns only digest for references that contain both tag and digest. Is this expected? #3

@davidxia

Description

@davidxia

I noticed that Parse() returns only the image digest for references that contain both tag and digest instead of both. Is this expected?

import (
	"fmt"
	parser "github.com/novln/docker-parser"
)

func main() {
	imageString := "kuberay/operator:v0.6.0@sha256:cc8ce713f3b4be3c72cca1f63ee78e3733bc7283472ecae367b47a128f7e4478"
	ref, err := parser.Parse(imageString)
	if err != nil {
		panic(err)
	}

	fmt.Printf("Tag: %s\n", ref.Tag())
}

Output

Tag: sha256:cc8ce713f3b4be3c72cca1f63ee78e3733bc7283472ecae367b47a128f7e4478

I expected

Tag: v0.6.0@sha256:cc8ce713f3b4be3c72cca1f63ee78e3733bc7283472ecae367b47a128f7e4478

Would be great if this library supported a way to get both tag and digest if both are in the reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions