Skip to content

Commit

Permalink
Fix some unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzhang97 committed Apr 29, 2024
1 parent 27f675d commit 839a5d1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
10 changes: 6 additions & 4 deletions pkg/webhook/mutating_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ func Test_mutatingHandler_Handle(t *testing.T) {
AdmissionResponse: admissionv1.AdmissionResponse{
Allowed: false,
Result: &metav1.Status{
Code: http.StatusForbidden,
Reason: "oops, some error happened",
Code: http.StatusForbidden,
Reason: metav1.StatusReasonForbidden,
Message: "oops, some error happened",
},
},
},
Expand Down Expand Up @@ -314,8 +315,9 @@ func Test_mutatingHandler_Handle(t *testing.T) {
AdmissionResponse: admissionv1.AdmissionResponse{
Allowed: false,
Result: &metav1.Status{
Code: http.StatusForbidden,
Reason: "oops, some error happened",
Code: http.StatusForbidden,
Reason: metav1.StatusReasonForbidden,
Message: "oops, some error happened",
},
},
},
Expand Down
17 changes: 9 additions & 8 deletions pkg/webhook/validating_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ func Test_validatingHandler_Handle(t *testing.T) {
AdmissionResponse: admissionv1.AdmissionResponse{
Allowed: false,
Result: &metav1.Status{
Code: http.StatusForbidden,
Reason: "oops, some error happened",
Code: http.StatusForbidden,
Reason: metav1.StatusReasonForbidden,
Message: "oops, some error happened",
},
},
},
Expand Down Expand Up @@ -231,9 +232,9 @@ func Test_validatingHandler_Handle(t *testing.T) {
AdmissionResponse: admissionv1.AdmissionResponse{
Allowed: false,
Result: &metav1.Status{
Code: http.StatusForbidden,
Reason: "oops, some error happened",
},
Code: http.StatusForbidden,
Reason: metav1.StatusReasonForbidden,
Message: "oops, some error happened"},
},
},
},
Expand Down Expand Up @@ -324,9 +325,9 @@ func Test_validatingHandler_Handle(t *testing.T) {
AdmissionResponse: admissionv1.AdmissionResponse{
Allowed: false,
Result: &metav1.Status{
Code: http.StatusForbidden,
Reason: "oops, some error happened",
},
Code: http.StatusForbidden,
Reason: metav1.StatusReasonForbidden,
Message: "oops, some error happened"},
},
},
},
Expand Down

0 comments on commit 839a5d1

Please sign in to comment.