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
(cherry picked from commit 24d5658)
  • Loading branch information
gthiemonge committed Aug 6, 2024
1 parent ecb78a3 commit 0f78d59
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 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 @@ -591,6 +592,7 @@ func (r *OctaviaAmphoraControllerReconciler) generateServiceConfigMaps(
ipAddresses = append(ipAddresses, fmt.Sprintf("%s:5555", val))
}
}
sort.Strings(ipAddresses)
ipAddressString := strings.Join(ipAddresses, ",")
templateParameters["ControllerIPList"] = ipAddressString

Expand Down

0 comments on commit 0f78d59

Please sign in to comment.