mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +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 {
|
type cudTestCase struct {
|
||||||
name string
|
name string
|
||||||
create svcTestCase
|
create svcTestCase
|
||||||
update svcTestCase
|
beforeUpdate func(t *testing.T, storage *GenericREST)
|
||||||
|
update svcTestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
func helpTestCreateUpdateDelete(t *testing.T, testCases []cudTestCase) {
|
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)
|
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.
|
// Update the object to the new state and check the results.
|
||||||
obj, created, err := storage.Update(ctx, tc.update.svc.Name,
|
obj, created, err := storage.Update(ctx, tc.update.svc.Name,
|
||||||
rest.DefaultUpdatedObjectInfo(tc.update.svc), rest.ValidateAllObjectFunc,
|
rest.DefaultUpdatedObjectInfo(tc.update.svc), rest.ValidateAllObjectFunc,
|
||||||
|
Loading…
Reference in New Issue
Block a user