Merge pull request #96906 from Rajalakshmi-Girish/issue-96853

Fixes the unit tests to be more tolerant with error messages

Kubernetes-commit: 10c1c3acf65cfb00de7fa28f784865bd42ab4872
This commit is contained in:
Kubernetes Publisher 2021-01-05 17:09:51 -08:00
commit c2a4b1a59a
4 changed files with 10 additions and 10 deletions

4
Godeps/Godeps.json generated
View File

@ -692,7 +692,7 @@
},
{
"ImportPath": "k8s.io/api",
"Rev": "9c6b1a9487e0"
"Rev": "9ab310c4912f"
},
{
"ImportPath": "k8s.io/apimachinery",
@ -700,7 +700,7 @@
},
{
"ImportPath": "k8s.io/client-go",
"Rev": "e9d996dae239"
"Rev": "9761a13537eb"
},
{
"ImportPath": "k8s.io/component-base",

8
go.mod
View File

@ -41,9 +41,9 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/square/go-jose.v2 v2.2.2
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.0.0-20201218085720-9c6b1a9487e0
k8s.io/api v0.0.0-20210105210245-9ab310c4912f
k8s.io/apimachinery v0.0.0-20210103120354-0ca7b349afd2
k8s.io/client-go v0.0.0-20201229090012-e9d996dae239
k8s.io/client-go v0.0.0-20210106050432-9761a13537eb
k8s.io/component-base v0.0.0-20201217090229-e05af43f81e2
k8s.io/klog/v2 v2.4.0
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd
@ -54,8 +54,8 @@ require (
)
replace (
k8s.io/api => k8s.io/api v0.0.0-20201218085720-9c6b1a9487e0
k8s.io/api => k8s.io/api v0.0.0-20210105210245-9ab310c4912f
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210103120354-0ca7b349afd2
k8s.io/client-go => k8s.io/client-go v0.0.0-20201229090012-e9d996dae239
k8s.io/client-go => k8s.io/client-go v0.0.0-20210106050432-9761a13537eb
k8s.io/component-base => k8s.io/component-base v0.0.0-20201217090229-e05af43f81e2
)

4
go.sum
View File

@ -599,9 +599,9 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20201218085720-9c6b1a9487e0/go.mod h1:RfHTN0YuX1yj8GjBNCMS6JbbdmX/jjszu9vXIt47SpM=
k8s.io/api v0.0.0-20210105210245-9ab310c4912f/go.mod h1:ugSMEpFie0GsLA3IjyrjlN2Qh3uydrt9YCmiq35Uwk0=
k8s.io/apimachinery v0.0.0-20210103120354-0ca7b349afd2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/client-go v0.0.0-20201229090012-e9d996dae239/go.mod h1:QnFOWF5TLJOP+E4gUNVwc3EPtaB+ZB8WGcyyBDoOHyI=
k8s.io/client-go v0.0.0-20210106050432-9761a13537eb/go.mod h1:MzH4jwc+euEAiFUHId2xQ1P0F4jHAQrNxngF8rnIIqY=
k8s.io/component-base v0.0.0-20201217090229-e05af43f81e2/go.mod h1:gIi+MRY/IzqtOlI456xyiW/eLgJnlivhxgZIlG3ueCQ=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=

View File

@ -123,7 +123,7 @@ func TestStrategicMergePatchInvalid(t *testing.T) {
if !apierrors.IsBadRequest(err) {
t.Errorf("expected HTTP status: BadRequest, got: %#v", apierrors.ReasonForError(err))
}
if err.Error() != expectedError {
if !strings.Contains(err.Error(), expectedError) {
t.Errorf("expected %#v, got %#v", expectedError, err.Error())
}
}
@ -171,7 +171,7 @@ func TestJSONPatch(t *testing.T) {
t.Errorf("%s: expect no error when applying json patch, but got %v", test.name, err)
continue
}
if err.Error() != test.expectedError {
if !strings.Contains(err.Error(), test.expectedError) {
t.Errorf("%s: expected error %v, but got %v", test.name, test.expectedError, err)
}
if test.expectedErrorType != apierrors.ReasonForError(err) {