Skip to content

Commit 13a19c3

Browse files
author
OpenShift Bot
committed
Merge pull request #2875 from deads2k/osc-status
Merged by openshift-bot
2 parents d73941c + 5020b74 commit 13a19c3

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

pkg/cmd/cli/describe/projectstatus.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,7 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error
7676

7777
return tabbedString(func(out *tabwriter.Writer) error {
7878
indent := " "
79-
if len(project.Annotations[projectapi.ProjectDisplayName]) > 0 &&
80-
project.Annotations[projectapi.ProjectDisplayName] != namespace {
81-
fmt.Fprintf(out, "In project %s (%s)\n", project.Annotations[projectapi.ProjectDisplayName], namespace)
82-
} else {
83-
fmt.Fprintf(out, "In project %s\n", namespace)
84-
}
79+
fmt.Fprintf(out, "In project %s\n", projectapi.DisplayNameAndNameForProject(project))
8580

8681
for _, group := range groups {
8782
if len(group.Builds) != 0 {
@@ -132,7 +127,7 @@ func printLines(out io.Writer, indent string, depth int, lines ...string) {
132127
func describeDeploymentInServiceGroup(deploy graph.DeploymentFlow) []string {
133128
includeLastPass := deploy.Deployment.ActiveDeployment == nil
134129
if len(deploy.Images) == 1 {
135-
lines := []string{fmt.Sprintf("%s deploys %s", deploy.Deployment.Name, describeImageInPipeline(deploy.Images[0], deploy.Deployment.Namespace))}
130+
lines := []string{fmt.Sprintf("%s deploys %s %s", deploy.Deployment.Name, describeImageInPipeline(deploy.Images[0], deploy.Deployment.Namespace), describeDeploymentConfigTrigger(deploy.Deployment.DeploymentConfig))}
136131
if len(lines[0]) > 120 && strings.Contains(lines[0], " <- ") {
137132
segments := strings.SplitN(lines[0], " <- ", 2)
138133
lines[0] = segments[0] + " <-"
@@ -142,7 +137,8 @@ func describeDeploymentInServiceGroup(deploy graph.DeploymentFlow) []string {
142137
lines = append(lines, describeDeployments(deploy.Deployment, 3)...)
143138
return lines
144139
}
145-
lines := []string{fmt.Sprintf("%s deploys:", deploy.Deployment.Name)}
140+
141+
lines := []string{fmt.Sprintf("%s deploys: %s", deploy.Deployment.Name, describeDeploymentConfigTrigger(deploy.Deployment.DeploymentConfig))}
146142
for _, image := range deploy.Images {
147143
lines = append(lines, describeImageInPipeline(image, deploy.Deployment.Namespace))
148144
lines = append(lines, describeAdditionalBuildDetail(image.Build, includeLastPass)...)
@@ -151,6 +147,14 @@ func describeDeploymentInServiceGroup(deploy graph.DeploymentFlow) []string {
151147
return lines
152148
}
153149

150+
func describeDeploymentConfigTrigger(dc *deployapi.DeploymentConfig) string {
151+
if len(dc.Triggers) == 0 {
152+
return "(manual)"
153+
}
154+
155+
return ""
156+
}
157+
154158
func describeStandaloneBuildGroup(pipeline graph.ImagePipeline, namespace string) []string {
155159
switch {
156160
case pipeline.Build != nil:

pkg/cmd/cli/describe/projectstatus_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestProjectStatus(t *testing.T) {
4040
Name: "example",
4141
Namespace: "",
4242
Annotations: map[string]string{
43-
"openshift.io/display-name": "Test",
43+
projectapi.ProjectDisplayName: "Test",
4444
},
4545
},
4646
},

0 commit comments

Comments
 (0)