Skip to content

Commit

Permalink
Always sort lists in the config files
Browse files Browse the repository at this point in the history
When build the template variables for the config files, we cannot ensure
that we always build the lists in the same order, sort them to avoid
potential recreation of the pods.

JIRA: OSPRH-9128
  • Loading branch information
gthiemonge committed Aug 5, 2024
1 parent be5fe24 commit 24d5658
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/amphoracontroller_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package controllers
import (
"context"
"fmt"
"sort"
"strings"
"time"

Expand Down Expand Up @@ -596,6 +597,8 @@ func (r *OctaviaAmphoraControllerReconciler) generateServiceConfigMaps(
rsyslogIPAddresses = append(rsyslogIPAddresses, fmt.Sprintf("%s:514", val))
}
}
sort.Strings(ipAddresses)
sort.Strings(rsyslogIPAddresses)
ipAddressString := strings.Join(ipAddresses, ",")
templateParameters["ControllerIPList"] = ipAddressString
templateParameters["AdminLogTargetList"] = strings.Join(rsyslogIPAddresses, ",")
Expand Down

0 comments on commit 24d5658

Please sign in to comment.