You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added conditional to project list that will suppress project
list output on login if the list is greater than 50.
One last commit to correct suppressed being misspelled
Bug 1542326
Copy file name to clipboardexpand all lines: pkg/oc/cli/cmd/login/loginoptions.go
+15-8
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,8 @@ import (
34
34
35
35
constdefaultClusterURL="https://localhost:8443"
36
36
37
+
constprojectsItemsSuppressThreshold=50
38
+
37
39
// LoginOptions is a helper for the login and setup process, gathers all information required for a
38
40
// successful login and eventual update of config files.
39
41
// Depending on the Reader present it can be interactive, asking for terminal input in
@@ -316,16 +318,21 @@ func (o *LoginOptions) gatherProjectInfo() error {
316
318
returnerr
317
319
}
318
320
o.Project=current.Name
319
-
320
-
fmt.Fprintf(o.Out, "You have access to the following projects and can switch between them with '%s project <projectname>':\n\n", o.CommandName)
321
-
for_, p:=rangeprojects.List() {
322
-
ifo.Project==p {
323
-
fmt.Fprintf(o.Out, " * %s\n", p)
324
-
} else {
325
-
fmt.Fprintf(o.Out, " %s\n", p)
321
+
322
+
// Suppress project listing if the number of projects available to the user is greater than the threshold. Prevents unnecessarily noisy logins on clusters with large numbers of projects
fmt.Fprintf(o.Out, "You have access to %d projects, the list has been suppressed. You can list all projects with '%s projects'\n\n", len(projectsItems), o.CommandName)
325
+
} else {
326
+
fmt.Fprintf(o.Out, "You have access to the following projects and can switch between them with '%s project <projectname>':\n\n", o.CommandName)
0 commit comments