Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #915 from jpodivin/sort-ssh
Browse files Browse the repository at this point in the history
Sorting ssh keys before adding them to ansibleee resource
  • Loading branch information
openshift-merge-bot[bot] authored Jun 4, 2024
2 parents 66a037a + 97433e1 commit 7b11917
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/util/ansible_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ func AnsibleExecution(
ansibleEE.Spec.ExtraVars["edpm_services_override"] = json.RawMessage([]byte(fmt.Sprintf("\"%s\"", deployment.Spec.ServicesOverride)))
}

for sshKeyNodeName, sshKeySecret := range sshKeySecrets {
// Sort keys of the ssh secret map
sshKeys := make([]string, 0)
for k := range sshKeySecrets {
sshKeys = append(sshKeys, k)
}
sort.Strings(sshKeys)

for _, sshKeyNodeName := range sshKeys {
sshKeySecret := sshKeySecrets[sshKeyNodeName]
if service.Spec.DeployOnAllNodeSets {
sshKeyName = fmt.Sprintf("ssh-key-%s", sshKeyNodeName)
sshKeyMountSubPath = fmt.Sprintf("ssh_key_%s", sshKeyNodeName)
Expand Down

0 comments on commit 7b11917

Please sign in to comment.