File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1616package controllers
1717
1818import (
19+ "unicode"
20+
1921 dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
2022 corev1 "k8s.io/api/core/v1"
2123
@@ -65,7 +67,7 @@ func (c *workspaceConditions) setConditionTrueWithReason(conditionType dw.DevWor
6567
6668 c .conditions [conditionType ] = dw.DevWorkspaceCondition {
6769 Status : corev1 .ConditionTrue ,
68- Message : msg ,
70+ Message : capitalizeMessage ( msg ) ,
6971 Reason : reason ,
7072 }
7173}
@@ -130,3 +132,13 @@ func getConditionIndexInOrder(condType dw.DevWorkspaceConditionType) int {
130132 }
131133 return - 1
132134}
135+
136+ // Capitalizes the first character in the given string.
137+ func capitalizeMessage (msg string ) string {
138+ if msg == "" {
139+ return msg
140+ }
141+ runes := []rune (msg )
142+ runes [0 ] = unicode .ToUpper (runes [0 ])
143+ return string (runes )
144+ }
You can’t perform that action at this time.
0 commit comments