mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-27 20:42:58 +00:00
fix(test): fix TestGetPodResourcesV1 comparison logic in tests
This commit is contained in:
parent
9a24dd2c27
commit
e187368242
@ -705,13 +705,18 @@ func TestGetPodResourcesV1(t *testing.T) {
|
|||||||
server := NewV1PodResourcesServer(providers)
|
server := NewV1PodResourcesServer(providers)
|
||||||
podReq := &podresourcesapi.GetPodResourcesRequest{PodName: podName, PodNamespace: podNamespace}
|
podReq := &podresourcesapi.GetPodResourcesRequest{PodName: podName, PodNamespace: podNamespace}
|
||||||
resp, err := server.Get(context.TODO(), podReq)
|
resp, err := server.Get(context.TODO(), podReq)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() != tc.err.Error() {
|
if err.Error() != tc.err.Error() {
|
||||||
t.Errorf("want exit = %v, got %v", tc.err, err)
|
t.Errorf("want exit = %v, got %v", tc.err, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !equalGetResponse(tc.expectedResponse, resp) {
|
if err != tc.err {
|
||||||
t.Errorf("want resp = %s, got %s", tc.expectedResponse.String(), resp.String())
|
t.Errorf("want exit = %v, got %v", tc.err, err)
|
||||||
|
} else {
|
||||||
|
if !equalGetResponse(tc.expectedResponse, resp) {
|
||||||
|
t.Errorf("want resp = %s, got %s", tc.expectedResponse.String(), resp.String())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user