Skip to content

Commit 0ed0858

Browse files
committed
Merge pull request kubernetes#2149 from claire921/r_health
Refactor Status.String() in health pkg
2 parents c7ff310 + 5e3193a commit 0ed0858

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/health/health.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ func findPortByName(container api.Container, portName string) int {
103103
}
104104

105105
func (s Status) String() string {
106-
if s == Healthy {
106+
switch s {
107+
case Healthy:
107108
return "healthy"
108-
} else if s == Unhealthy {
109+
case Unhealthy:
109110
return "unhealthy"
111+
default:
112+
return "unknown"
110113
}
111-
return "unknown"
112114
}

0 commit comments

Comments
 (0)