Skip to content

Commit 54d8779

Browse files
committed
Sort the names of the names of the providers in the print command
* Previously the help string for `print --providers` had a non-deterministic ordering since it is generated from map keys. * This will be helpful in tackling #162
1 parent 936b78e commit 54d8779

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/i2gw/ingress2gateway.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package i2gw
1919
import (
2020
"context"
2121
"fmt"
22+
"sort"
2223

2324
"github.com/kubernetes-sigs/ingress2gateway/pkg/i2gw/notifications"
2425
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -136,6 +137,8 @@ func GetSupportedProviders() []string {
136137
for key := range ProviderConstructorByName {
137138
supportedProviders = append(supportedProviders, string(key))
138139
}
140+
// Sort the provider names for consistent output.
141+
sort.Strings(supportedProviders)
139142
return supportedProviders
140143
}
141144

0 commit comments

Comments
 (0)