@@ -386,10 +386,10 @@ func (r *ReconcileGitopsService) reconcileDeployment(cr *pipelinesv1alpha1.Gitop
386386
387387 // ADD THIS: Get ConfigMap and add hash to pod template annotations
388388 configMapHash := getConfigMapHash (newPluginConfigMap )
389- if newPluginDeployment .Spec .Template .ObjectMeta . Annotations == nil {
390- newPluginDeployment .Spec .Template .ObjectMeta . Annotations = make (map [string ]string )
389+ if newPluginDeployment .Spec .Template .Annotations == nil {
390+ newPluginDeployment .Spec .Template .Annotations = make (map [string ]string )
391391 }
392- newPluginDeployment .Spec .Template .ObjectMeta . Annotations ["httpd-cfg-hash" ] = configMapHash
392+ newPluginDeployment .Spec .Template .Annotations ["httpd-cfg-hash" ] = configMapHash
393393
394394 // Check if this Deployment already exists
395395 existingPluginDeployment := & appsv1.Deployment {}
@@ -413,7 +413,7 @@ func (r *ReconcileGitopsService) reconcileDeployment(cr *pipelinesv1alpha1.Gitop
413413 ! equality .Semantic .DeepEqual (existingPluginDeployment .Spec .Replicas , newPluginDeployment .Spec .Replicas ) ||
414414 ! equality .Semantic .DeepEqual (existingPluginDeployment .Spec .Selector , newPluginDeployment .Spec .Selector ) ||
415415 ! equality .Semantic .DeepEqual (existingSpecTemplate .Labels , newSpecTemplate .Labels ) ||
416- ! equality .Semantic .DeepEqual (existingSpecTemplate .ObjectMeta . Annotations ["httpd-cfg-hash" ], newSpecTemplate . ObjectMeta .Annotations ["httpd-cfg-hash" ]) ||
416+ ! equality .Semantic .DeepEqual (existingSpecTemplate .Annotations ["httpd-cfg-hash" ], newSpecTemplate .Annotations ["httpd-cfg-hash" ]) ||
417417 ! equality .Semantic .DeepEqual (sortContainers (existingSpecTemplate .Spec .Containers ), sortContainers (newSpecTemplate .Spec .Containers )) ||
418418 ! equality .Semantic .DeepEqual (sortVolumes (existingSpecTemplate .Spec .Volumes ), sortVolumes (newSpecTemplate .Spec .Volumes )) ||
419419 ! equality .Semantic .DeepEqual (existingSpecTemplate .Spec .RestartPolicy , newSpecTemplate .Spec .RestartPolicy ) ||
@@ -424,15 +424,15 @@ func (r *ReconcileGitopsService) reconcileDeployment(cr *pipelinesv1alpha1.Gitop
424424 ! equality .Semantic .DeepEqual (existingSpecTemplate .Spec .Containers [0 ].Resources , newSpecTemplate .Spec .Containers [0 ].Resources )
425425
426426 if changed {
427- if existingSpecTemplate .ObjectMeta . Annotations == nil {
428- existingSpecTemplate .ObjectMeta . Annotations = make (map [string ]string )
427+ if existingSpecTemplate .Annotations == nil {
428+ existingSpecTemplate .Annotations = make (map [string ]string )
429429 }
430430 reqLogger .Info ("Reconciling plugin deployment" , "Namespace" , existingPluginDeployment .Namespace , "Name" , existingPluginDeployment .Name )
431431 existingPluginDeployment .Labels = newPluginDeployment .Labels
432432 existingPluginDeployment .Spec .Replicas = newPluginDeployment .Spec .Replicas
433433 existingPluginDeployment .Spec .Selector = newPluginDeployment .Spec .Selector
434434 existingSpecTemplate .Labels = newSpecTemplate .Labels
435- existingSpecTemplate .ObjectMeta . Annotations ["httpd-cfg-hash" ] = newSpecTemplate . ObjectMeta .Annotations ["httpd-cfg-hash" ]
435+ existingSpecTemplate .Annotations ["httpd-cfg-hash" ] = newSpecTemplate .Annotations ["httpd-cfg-hash" ]
436436 existingSpecTemplate .Spec .SecurityContext = newSpecTemplate .Spec .SecurityContext
437437 existingSpecTemplate .Spec .Containers = newSpecTemplate .Spec .Containers
438438 existingSpecTemplate .Spec .Volumes = newSpecTemplate .Spec .Volumes
0 commit comments