validateTag checks if the given image name can be resolved, and ensures the latest tag is added if it is missing.
(repo string)
| 97 | |
| 98 | // validateTag checks if the given image name can be resolved, and ensures the latest tag is added if it is missing. |
| 99 | func 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 | |
| 111 | func (cmd *buildCommand) ValidateArgs(c *cobra.Command, args []string) error { |
| 112 | if len(args) < 1 { |
no test coverage detected
searching dependent graphs…