Plumb context to admission Admit/Validate

This commit is contained in:
Jordan Liggitt
2019-08-19 10:48:08 -04:00
parent 89d5c1f3ea
commit 61774cd717
109 changed files with 404 additions and 323 deletions

View File

@@ -115,14 +115,15 @@ func (r *ScaleREST) Update(ctx context.Context, name string, objInfo rest.Update
}
func toScaleCreateValidation(f rest.ValidateObjectFunc) rest.ValidateObjectFunc {
return func(obj runtime.Object) error {
return f(scaleFromRC(obj.(*api.ReplicationController)))
return func(ctx context.Context, obj runtime.Object) error {
return f(ctx, scaleFromRC(obj.(*api.ReplicationController)))
}
}
func toScaleUpdateValidation(f rest.ValidateObjectUpdateFunc) rest.ValidateObjectUpdateFunc {
return func(obj, old runtime.Object) error {
return func(ctx context.Context, obj, old runtime.Object) error {
return f(
ctx,
scaleFromRC(obj.(*api.ReplicationController)),
scaleFromRC(old.(*api.ReplicationController)),
)