mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #12482 from tmrts/refactor/iota
Refactor probe.Result enumeration
This commit is contained in:
commit
531d3def98
@ -89,7 +89,7 @@ func TestValidate(t *testing.T) {
|
||||
t.Errorf("expected empty string, got %s", status)
|
||||
}
|
||||
if status != test.expectedStatus {
|
||||
t.Errorf("expected %s, got %s", test.expectedStatus.String(), status.String())
|
||||
t.Errorf("expected %s, got %s", test.expectedStatus, status)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,22 +16,10 @@ limitations under the License.
|
||||
|
||||
package probe
|
||||
|
||||
type Result int
|
||||
type Result string
|
||||
|
||||
// Status values must be one of these constants.
|
||||
const (
|
||||
Success Result = iota
|
||||
Failure
|
||||
Unknown
|
||||
Success Result = "success"
|
||||
Failure Result = "failure"
|
||||
Unknown Result = "unknown"
|
||||
)
|
||||
|
||||
func (s Result) String() string {
|
||||
switch s {
|
||||
case Success:
|
||||
return "success"
|
||||
case Failure:
|
||||
return "failure"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user