Equal returns if one image is the same as another
(other *Image)
| 58 | |
| 59 | // Equal returns if one image is the same as another |
| 60 | func (i *Image) Equal(other *Image) bool { |
| 61 | if other == nil { |
| 62 | return false |
| 63 | } |
| 64 | |
| 65 | if i.tag != other.tag { |
| 66 | return false |
| 67 | } |
| 68 | |
| 69 | if i.image.String() != other.image.String() { |
| 70 | return false |
| 71 | } |
| 72 | |
| 73 | if i.Build == nil && other.Build != nil { |
| 74 | return false |
| 75 | } |
| 76 | |
| 77 | if i.Build != nil { |
| 78 | if !i.Build.Equal(other.Build) { |
| 79 | return false |
| 80 | } |
| 81 | } |
| 82 | return true |
| 83 | } |
| 84 | |
| 85 | // FromString creates an Image using a string representation |
| 86 | func FromString(str string) (*Image, error) { |