Plumb context to admission Admit/Validate
This commit is contained in:
@@ -203,14 +203,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)),
|
||||
)
|
||||
|
Reference in New Issue
Block a user