MCPcopy
hub / github.com/genuinetools/img / validateTag

Function validateTag

build.go:99–109  ·  view source on GitHub ↗

validateTag checks if the given image name can be resolved, and ensures the latest tag is added if it is missing.

(repo string)

Source from the content-addressed store, hash-verified

97
98// validateTag checks if the given image name can be resolved, and ensures the latest tag is added if it is missing.
99func validateTag(repo string) (string, error) {
100 named, err := reference.ParseNormalizedNamed(repo)
101 if err != nil {
102 return "", err
103 }
104
105 // Add the latest tag if they did not provide one.
106 repo = reference.TagNameOnly(named).String()
107
108 return repo, nil
109}
110
111func (cmd *buildCommand) ValidateArgs(c *cobra.Command, args []string) error {
112 if len(args) < 1 {

Callers 1

ValidateArgsMethod · 0.85

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…