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
When one project (which includes a display-name) exists (e.g. after a clean cluster up):
$ oc projects -q
My Project (myproject)
$ oc new-project temp
$ oc projects -q
myproject
temp
Current Result
Depending on the project metadata, the oc projects -q either includes or excludes the display-name of the project.
Expected Result
The -q flag is ideal for programmatic integration (e.g. iterating through projects from a shell script). The display-name being included in some output introduces unnecessary & somewhat unpredictable parsing requirements.
The text was updated successfully, but these errors were encountered:
I believe this is a pretty easy to fix with this patch but waiting for confirmation before sending a pull-req
diff --git a/pkg/cmd/cli/cmd/projects.go b/pkg/cmd/cli/cmd/projects.go
index c43bd93..e1ff49d 100644
--- a/pkg/cmd/cli/cmd/projects.go
+++ b/pkg/cmd/cli/cmd/projects.go
@@ -144,7 +144,7 @@ func (o ProjectsOptions) RunProjects() error {
msg += "You are not a member of any projects. You can request a project to be created with the 'new-project' command."
case 1:
if o.DisplayShort {
- msg += fmt.Sprintf("%s", api.DisplayNameAndNameForProject(&projects[0]))
+ msg += fmt.Sprintf("%s", &projects[0].Name)
} else {
msg += fmt.Sprintf("You have one project on this server: %q.", api.DisplayNameAndNameForProject(&projects[0]))
}
Seems reasonable to me, even the flag mentions it only displays the projects names, with no reference to the display names. I'll defer the decision to @juanvallejo.
oc projects -q sometimes includes project display-names and sometimes it does not.
Version
oc v1.5.0-alpha.0+cd418ff-255-dirty
kubernetes v1.4.0+776c994
features: Basic-Auth
Steps To Reproduce
When one project (which includes a display-name) exists (e.g. after a clean cluster up):
$ oc projects -q
My Project (myproject)
$ oc new-project temp
$ oc projects -q
myproject
temp
Current Result
Depending on the project metadata, the
oc projects -q
either includes or excludes the display-name of the project.Expected Result
The -q flag is ideal for programmatic integration (e.g. iterating through projects from a shell script). The display-name being included in some output introduces unnecessary & somewhat unpredictable parsing requirements.
The text was updated successfully, but these errors were encountered: