Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes provider sort order #131

Merged
merged 3 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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