fix: Fix image puller reconcile infinite loop when checluster image puller deployment name and configmap name are empty

Signed-off-by: Flavius Lacatusu <flacatus@redhat.com>
pull/878/head
Flavius Lacatusu 2021-06-25 11:04:56 +02:00
parent e87c87dcc3
commit 3b05cdfca7
No known key found for this signature in database
GPG Key ID: 1F5C00691820AC13
1 changed files with 7 additions and 0 deletions

View File

@ -141,6 +141,13 @@ func ReconcileImagePuller(ctx *DeployContext) (reconcile.Result, error) {
return reconcile.Result{}, err
}
if ctx.CheCluster.Spec.ImagePuller.Spec.DeploymentName == "" {
ctx.CheCluster.Spec.ImagePuller.Spec.DeploymentName = imagePuller.Spec.DeploymentName
}
if ctx.CheCluster.Spec.ImagePuller.Spec.ConfigMapName == "" {
ctx.CheCluster.Spec.ImagePuller.Spec.ConfigMapName = imagePuller.Spec.ConfigMapName
}
// If ImagePuller specs are different, update the KubernetesImagePuller CR
if imagePuller.Spec != ctx.CheCluster.Spec.ImagePuller.Spec {
imagePuller.Spec = ctx.CheCluster.Spec.ImagePuller.Spec