Skip to content

Commit 36c9792

Browse files
authored
Sort the names of the names of the providers in the print command (#219)
* 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 38c526a commit 36c9792

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"
@@ -139,6 +140,8 @@ func GetSupportedProviders() []string {
139140
for key := range ProviderConstructorByName {
140141
supportedProviders = append(supportedProviders, string(key))
141142
}
143+
// Sort the provider names for consistent output.
144+
sort.Strings(supportedProviders)
142145
return supportedProviders
143146
}
144147

0 commit comments

Comments
 (0)