func (d *Deployment) ensureImages(ctx context.Context, apiObject *api.ArangoDeployment, cachedStatus inspectorInterface.Inspector) (bool, bool, error) {
	status, lastVersion := d.GetStatus()
	ib := imagesBuilder{
		Context:   d,
		APIObject: apiObject,
		Spec:      apiObject.Spec,
		Status:    status,
		Log:       d.deps.Log,
		UpdateCRStatus: func(status api.DeploymentStatus) error {
			if err := d.UpdateStatus(ctx, status, lastVersion); err != nil {
				return errors.WithStack(err)
			}
			return nil
		},
	}
	retrySoon, exists, err := ib.Run(ctx, cachedStatus)
	if err != nil {
		return retrySoon, exists, errors.WithStack(err)
	}
	return retrySoon, exists, nil
}
ensureImages creates pods needed to detect ImageID for specified images.
Returns: retrySoon, error
package deployment
import (
	"context"
	"crypto/sha1"
	"fmt"
	"strings"
	"time"
	inspectorInterface "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/inspector"
	"github.com/arangodb/kube-arangodb/pkg/util/errors"
	"github.com/arangodb/kube-arangodb/pkg/util/k8sutil/interfaces"
	"github.com/arangodb/kube-arangodb/pkg/deployment/pod"
	"github.com/rs/zerolog"
	core "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
	"github.com/arangodb/kube-arangodb/pkg/deployment/resources"
	"github.com/arangodb/kube-arangodb/pkg/util/arangod"
	"github.com/arangodb/kube-arangodb/pkg/util/constants"
	"github.com/arangodb/kube-arangodb/pkg/util/k8sutil"
)
var _ interfaces.PodCreator = &ImageUpdatePod{}
var _ interfaces.ContainerCreator = &ArangoDImageUpdateContainer{}
type ImageUpdatePod struct {
	spec      api.DeploymentSpec
	apiObject k8sutil.APIObject
	image     string
}
func (i *ImageUpdatePod) Annotations() map[string]string {
	return nil
}
func (i *ImageUpdatePod) Labels() map[string]string {
	return nil
}
type ArangoDImageUpdateContainer struct {
	spec  api.DeploymentSpec
	image string
}
type imagesBuilder struct {
	Context        resources.Context
	APIObject      k8sutil.APIObject
	Spec           api.DeploymentSpec
	Status         api.DeploymentStatus
	Log            zerolog.Logger
	UpdateCRStatus func(status api.DeploymentStatus) error
}