Skip to content

Commit

Permalink
fix after review
Browse files Browse the repository at this point in the history
Signed-off-by: Horiodino <[email protected]>
  • Loading branch information
Horiodino committed Jul 5, 2024
1 parent e758926 commit f56a79c
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions controllers/workspace/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package controllers

import (
"unicode"

dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
"golang.org/x/text/cases"
"golang.org/x/text/language"
corev1 "k8s.io/api/core/v1"

"github.com/devfile/devworkspace-operator/pkg/conditions"
Expand Down Expand Up @@ -67,7 +67,7 @@ func (c *workspaceConditions) setConditionTrueWithReason(conditionType dw.DevWor

c.conditions[conditionType] = dw.DevWorkspaceCondition{
Status: corev1.ConditionTrue,
Message: capitalizeMsg(msg),
Message: cases.Title(language.English, cases.NoLower).String(msg),
Reason: reason,
}
}
Expand Down Expand Up @@ -132,12 +132,3 @@ func getConditionIndexInOrder(condType dw.DevWorkspaceConditionType) int {
}
return -1
}

func capitalizeMsg(msg string) string {
if len(msg) == 0 {
return msg
}
runes := []rune(msg)
runes[0] = unicode.ToUpper(runes[0])
return string(runes)
}

0 comments on commit f56a79c

Please sign in to comment.