diff --git a/pkg/deployment/images.go b/pkg/deployment/images.go index 479305f5c..4701b5707 100644 --- a/pkg/deployment/images.go +++ b/pkg/deployment/images.go @@ -119,7 +119,7 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, ima log.Warn().Msg("Empty list of ContainerStatuses") return true, nil } - imageID := k8sutil.ConvertImageID2Image(pod.Status.ContainerStatuses[0].ImageID) + imageID := k8sutil.GetArangoDBImageIDFromPod(pod) if imageID == "" { // Fall back to specified image imageID = image diff --git a/pkg/util/k8sutil/images.go b/pkg/util/k8sutil/images.go index f5f2327b6..e0e171652 100644 --- a/pkg/util/k8sutil/images.go +++ b/pkg/util/k8sutil/images.go @@ -22,7 +22,11 @@ package k8sutil -import "strings" +import ( + "strings" + + corev1 "k8s.io/api/core/v1" +) const ( dockerPullableImageIDPrefix = "docker-pullable://" @@ -36,3 +40,16 @@ func ConvertImageID2Image(imageID string) string { } return imageID } + +// GetArangoDBImageIDFromPod returns the ArangoDB specific image from a pod +func GetArangoDBImageIDFromPod(pod *corev1.Pod) string { + rawImageID := pod.Status.ContainerStatuses[0].ImageID + if len(pod.Status.ContainerStatuses) > 1 { + for _, containerStatus := range pod.Status.ContainerStatuses { + if strings.Contains(containerStatus.ImageID, "arango") { + rawImageID = containerStatus.ImageID + } + } + } + return ConvertImageID2Image(rawImageID) +}