Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
Sort namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
snorwin committed Mar 25, 2021
1 parent 53c87df commit f898d54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions controllers/argocd/argocd_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package argocd
import (
"context"
"os"
"sort"
"strconv"
"strings"

Expand Down Expand Up @@ -214,6 +215,9 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
}
slice = add(slice, req.Namespace)

// sort namespaces
sort.Strings(slice)

values["namespaces"] = slice
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/argocd/argocd_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ var _ = Describe("Reconciler", func() {

mockHelm.
EXPECT().
Upgrade(argocd.Name, gomock.Any(), Values("namespaces", []string{"myapp3", "myapp4", "default"}), true).
Upgrade(argocd.Name, gomock.Any(), Values("namespaces", []string{"default", "myapp3", "myapp4"}), true).
Return(nil)

testReconcile(mockHelm, argocd, namespaces...)
Expand Down

0 comments on commit f898d54

Please sign in to comment.