@@ -76,11 +76,12 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error
76
76
77
77
return tabbedString (func (out * tabwriter.Writer ) error {
78
78
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 )
79
+ fmt .Fprintf (out , "In project %s\n " , projectapi .DisplayNameAndNameForProject (project ))
80
+
81
+ if disabledDCs := disabledDeploymentConfigs (dcs ); len (disabledDCs ) > 0 {
82
+ fmt .Fprintln (out )
83
+ fmt .Fprintln (out , "Some DeploymentConfigs do not have any automatic triggers. They can only be triggered by manually calling `osc deploy <name> --latest`." )
84
+ printLines (out , indent , 1 , describeDisabledDeploymentConfigs (disabledDCs )... )
84
85
}
85
86
86
87
for _ , group := range groups {
@@ -119,6 +120,25 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error
119
120
})
120
121
}
121
122
123
+ func disabledDeploymentConfigs (dcs * deployapi.DeploymentConfigList ) []deployapi.DeploymentConfig {
124
+ disabledDCs := []deployapi.DeploymentConfig {}
125
+ for _ , dc := range dcs .Items {
126
+ if len (dc .Triggers ) == 0 {
127
+ disabledDCs = append (disabledDCs , dc )
128
+ }
129
+ }
130
+
131
+ return disabledDCs
132
+ }
133
+ func describeDisabledDeploymentConfigs (dcs []deployapi.DeploymentConfig ) []string {
134
+ lines := []string {}
135
+ for _ , dc := range dcs {
136
+ lines = append (lines , fmt .Sprintf ("%s - trigger a new Deployment by running `osc deploy %s --latest`" , dc .Name , dc .Name ))
137
+ }
138
+
139
+ return lines
140
+ }
141
+
122
142
func printLines (out io.Writer , indent string , depth int , lines ... string ) {
123
143
for i , s := range lines {
124
144
fmt .Fprintf (out , strings .Repeat (indent , depth ))
0 commit comments