@@ -188,15 +188,15 @@ func (p *Prometheus) pullImage(imageName, dstName string, progressCh chan types.
188188 return nil
189189}
190190
191- /* GetImageByDigest returns an image from the Prometheus store by its digest . */
192- func (p * Prometheus ) GetImageByDigest ( digest string ) (cstorage.Image , error ) {
191+ /* GetImageById returns an image from the Prometheus store by its ID . */
192+ func (p * Prometheus ) GetImageById ( id string ) (cstorage.Image , error ) {
193193 images , err := p .Store .Images ()
194194 if err != nil {
195195 return cstorage.Image {}, err
196196 }
197197
198198 for _ , img := range images {
199- if img .ID == digest {
199+ if img .ID == id {
200200 return img , nil
201201 }
202202 }
@@ -205,16 +205,15 @@ func (p *Prometheus) GetImageByDigest(digest string) (cstorage.Image, error) {
205205 return cstorage.Image {}, err
206206}
207207
208- /* DoesImageExist checks if an image exists in the Prometheus store by its
209- * digest. It returns a boolean indicating if the image exists and an error
210- * if any. */
211- func (p * Prometheus ) DoesImageExist (digest string ) (bool , error ) {
212- image , err := p .GetImageByDigest (digest )
208+ /* DoesImageExist checks if an image exists in the Prometheus store by its ID.
209+ * It returns a boolean indicating if the image exists and an error if any. */
210+ func (p * Prometheus ) DoesImageExist (id string ) (bool , error ) {
211+ image , err := p .GetImageById (id )
213212 if err != nil {
214213 return false , err
215214 }
216215
217- if image .ID == digest {
216+ if image .ID == id {
218217 return true , nil
219218 }
220219
@@ -259,7 +258,7 @@ func (p *Prometheus) BuildContainerFile(dockerfilePath string, imageName string)
259258 return cstorage.Image {}, err
260259 }
261260
262- image , err := p .GetImageByDigest (id )
261+ image , err := p .GetImageById (id )
263262 if err != nil {
264263 return cstorage.Image {}, err
265264 }
0 commit comments