mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
Merge pull request #16876 from hongchaodeng/fix-16721
Auto commit by PR queue bot
This commit is contained in:
commit
0abc12ce5a
@ -88,7 +88,7 @@ func testData() (*api.PodList, *api.ServiceList, *api.ReplicationControllerList)
|
|||||||
func testComponentStatusData() *api.ComponentStatusList {
|
func testComponentStatusData() *api.ComponentStatusList {
|
||||||
good := api.ComponentStatus{
|
good := api.ComponentStatus{
|
||||||
Conditions: []api.ComponentCondition{
|
Conditions: []api.ComponentCondition{
|
||||||
{Type: api.ComponentHealthy, Status: api.ConditionTrue, Message: "ok", Error: "nil"},
|
{Type: api.ComponentHealthy, Status: api.ConditionTrue, Message: "ok"},
|
||||||
},
|
},
|
||||||
ObjectMeta: api.ObjectMeta{Name: "servergood"},
|
ObjectMeta: api.ObjectMeta{Name: "servergood"},
|
||||||
}
|
}
|
||||||
|
@ -85,11 +85,9 @@ func ToConditionStatus(s probe.Result) api.ConditionStatus {
|
|||||||
func (rs *REST) getComponentStatus(name string, server apiserver.Server) *api.ComponentStatus {
|
func (rs *REST) getComponentStatus(name string, server apiserver.Server) *api.ComponentStatus {
|
||||||
transport := rs.rt
|
transport := rs.rt
|
||||||
status, msg, err := server.DoServerCheck(transport)
|
status, msg, err := server.DoServerCheck(transport)
|
||||||
var errorMsg string
|
errorMsg := ""
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorMsg = err.Error()
|
errorMsg = err.Error()
|
||||||
} else {
|
|
||||||
errorMsg = "nil"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
c := &api.ComponentCondition{
|
c := &api.ComponentCondition{
|
||||||
|
@ -81,7 +81,7 @@ func TestList_NoError(t *testing.T) {
|
|||||||
t.Fatalf("Unexpected error: %v", err)
|
t.Fatalf("Unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
expect := &api.ComponentStatusList{
|
expect := &api.ComponentStatusList{
|
||||||
Items: []api.ComponentStatus{*(createTestStatus("test1", api.ConditionTrue, "ok", "nil"))},
|
Items: []api.ComponentStatus{*(createTestStatus("test1", api.ConditionTrue, "ok", ""))},
|
||||||
}
|
}
|
||||||
if e, a := expect, got; !reflect.DeepEqual(e, a) {
|
if e, a := expect, got; !reflect.DeepEqual(e, a) {
|
||||||
t.Errorf("Got unexpected object. Diff: %s", util.ObjectDiff(e, a))
|
t.Errorf("Got unexpected object. Diff: %s", util.ObjectDiff(e, a))
|
||||||
@ -124,7 +124,7 @@ func TestGet_NoError(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Unexpected error: %v", err)
|
t.Fatalf("Unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
expect := createTestStatus("test1", api.ConditionTrue, "ok", "nil")
|
expect := createTestStatus("test1", api.ConditionTrue, "ok", "")
|
||||||
if e, a := expect, got; !reflect.DeepEqual(e, a) {
|
if e, a := expect, got; !reflect.DeepEqual(e, a) {
|
||||||
t.Errorf("Got unexpected object. Diff: %s", util.ObjectDiff(e, a))
|
t.Errorf("Got unexpected object. Diff: %s", util.ObjectDiff(e, a))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user