Skip to content

Commit ba59f14

Browse files
author
Nigel Foucha
committed
fix ordering for container list merge to prefer incoming spec
1 parent 28e296a commit ba59f14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/resources/nifi/nifi.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ func (r *Reconciler) reconcileNifiPod(log zap.Logger, desiredPod *corev1.Pod) (e
682682
}
683683
// If there are extra initContainers from webhook injections we need to add them
684684
if len(currentPod.Spec.InitContainers) > len(desiredPod.Spec.InitContainers) {
685-
desiredPod.Spec.InitContainers = append(currentPod.Spec.InitContainers, desiredPod.Spec.InitContainers...)
685+
desiredPod.Spec.InitContainers = append(desiredPod.Spec.InitContainers, currentPod.Spec.InitContainers...)
686686
uniqueContainers := []corev1.Container{}
687687
keys := make(map[string]bool)
688688
for _, c := range desiredPod.Spec.InitContainers {
@@ -695,7 +695,7 @@ func (r *Reconciler) reconcileNifiPod(log zap.Logger, desiredPod *corev1.Pod) (e
695695
}
696696
// If there are extra containers from webhook injections we need to add them
697697
if len(currentPod.Spec.Containers) > len(desiredPod.Spec.Containers) {
698-
desiredPod.Spec.Containers = append(currentPod.Spec.Containers, desiredPod.Spec.Containers...)
698+
desiredPod.Spec.Containers = append(desiredPod.Spec.Containers, currentPod.Spec.Containers...)
699699
uniqueContainers := []corev1.Container{}
700700
keys := make(map[string]bool)
701701
for _, c := range desiredPod.Spec.Containers {

0 commit comments

Comments
 (0)