WithTag replaces the tag in the image reference.
(tag string)
| 54 | |
| 55 | // WithTag replaces the tag in the image reference. |
| 56 | func (i Image) WithTag(tag string) (Image, error) { |
| 57 | if i.named == nil { |
| 58 | return Image{}, fmt.Errorf("empty image") |
| 59 | } |
| 60 | tagged, err := reference.WithTag(reference.TrimNamed(i.named), tag) |
| 61 | if err != nil { |
| 62 | return i, err |
| 63 | } |
| 64 | return Image{named: tagged}, nil |
| 65 | } |
| 66 | |
| 67 | // Equal returns true if the given image reference begins with the current one. |
| 68 | // |
no outgoing calls
no test coverage detected