mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Svc REST: add a beforeUpdate hook in feature tests
This commit is contained in:
parent
ced629e657
commit
aea90a2324
@ -5991,9 +5991,10 @@ func proveHealthCheckNodePortDeallocated(t *testing.T, storage *GenericREST, bef
|
||||
}
|
||||
|
||||
type cudTestCase struct {
|
||||
name string
|
||||
create svcTestCase
|
||||
update svcTestCase
|
||||
name string
|
||||
create svcTestCase
|
||||
beforeUpdate func(t *testing.T, storage *GenericREST)
|
||||
update svcTestCase
|
||||
}
|
||||
|
||||
func helpTestCreateUpdateDelete(t *testing.T, testCases []cudTestCase) {
|
||||
@ -6029,6 +6030,11 @@ func helpTestCreateUpdateDelete(t *testing.T, testCases []cudTestCase) {
|
||||
}
|
||||
verifyExpectations(t, storage, tc.create, tc.create.svc, createdSvc)
|
||||
|
||||
// Allow callers to do something between create and update.
|
||||
if tc.beforeUpdate != nil {
|
||||
tc.beforeUpdate(t, storage)
|
||||
}
|
||||
|
||||
// Update the object to the new state and check the results.
|
||||
obj, created, err := storage.Update(ctx, tc.update.svc.Name,
|
||||
rest.DefaultUpdatedObjectInfo(tc.update.svc), rest.ValidateAllObjectFunc,
|
||||
|
Loading…
Reference in New Issue
Block a user