File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,14 @@ func SelectRoleCredentialsStartingFromCache() (string, *credentials.Role) {
177
177
return "" , role
178
178
}
179
179
180
+ func padAccountNumbers (aliases map [string ]string ) map [string ]string {
181
+ result := map [string ]string {}
182
+ for account , alias := range aliases {
183
+ result [fmt .Sprintf ("%012s" , account )] = alias
184
+ }
185
+ return result
186
+ }
187
+
180
188
func setupConfigFile () {
181
189
if homeDir , err := os .UserHomeDir (); err == nil {
182
190
os .MkdirAll (homeDir + "/.aws/knox" , os .FileMode (0700 ))
@@ -197,8 +205,9 @@ func setupConfigFile() {
197
205
tui .FilterStrategy = viper .GetString ("filter_strategy" )
198
206
selectCachedFirst = viper .GetBool ("select_cached_first" )
199
207
connectUid = viper .GetUint32 ("default_connect_uid" )
200
- accountAliases = viper .GetStringMapString ("account_aliases" )
208
+ accountAliases = padAccountNumbers ( viper .GetStringMapString ("account_aliases" ) )
201
209
instanceColTags = viper .GetStringSlice ("instance_col_tags" )
210
+
202
211
}
203
212
204
213
func init () {
You can’t perform that action at this time.
0 commit comments