Skip to content

Commit

Permalink
fixes provider sort order (#131)
Browse files Browse the repository at this point in the history
* fixes provider sort order
  • Loading branch information
ATGardner authored Jul 15, 2021
1 parent 6e853fd commit 9ef33bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/commands/argocd-autopilot_repo_bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ argocd-autopilot repo bootstrap [flags]
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
-n, --namespace string If present, the namespace scope for this CLI request
--namespaced If true, install a namespaced version of argo-cd (no need for cluster-role)
--provider string The git provider, one of: github|gitea
--provider string The git provider, one of: gitea|github
--repo string Repository URL [GIT_REPO]
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
```
Expand Down
2 changes: 2 additions & 0 deletions pkg/git/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package git
import (
"context"
"fmt"
"sort"
)

//go:generate mockery --name Provider --filename provider.go
Expand Down Expand Up @@ -70,5 +71,6 @@ func Providers() []string {
res = append(res, p)
}

sort.Strings(res) // must sort the providers by name, otherwise the codegen is not determenistic
return res
}
2 changes: 1 addition & 1 deletion pkg/git/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ func TestAddFlags(t *testing.T) {
wantedFlags: []flag{
{
name: "provider",
usage: "The git provider, one of: github|gitea",
usage: "The git provider, one of: gitea|github",
},
},
},
Expand Down

0 comments on commit 9ef33bf

Please sign in to comment.