diff --git a/pkg/registry/core/pod/storage/eviction.go b/pkg/registry/core/pod/storage/eviction.go index 1baab623a85..21362cc3f76 100644 --- a/pkg/registry/core/pod/storage/eviction.go +++ b/pkg/registry/core/pod/storage/eviction.go @@ -89,7 +89,7 @@ func (r *EvictionREST) Create(ctx context.Context, obj runtime.Object, createVal pod := obj.(*api.Pod) if createValidation != nil { - if err := createValidation(eviction); err != nil { + if err := createValidation(eviction.DeepCopyObject()); err != nil { return nil, err } } diff --git a/pkg/registry/core/pod/storage/storage.go b/pkg/registry/core/pod/storage/storage.go index b3cdd393fb0..311f2a3c724 100644 --- a/pkg/registry/core/pod/storage/storage.go +++ b/pkg/registry/core/pod/storage/storage.go @@ -150,7 +150,7 @@ func (r *BindingREST) Create(ctx context.Context, obj runtime.Object, createVali } if createValidation != nil { - if err := createValidation(binding); err != nil { + if err := createValidation(binding.DeepCopyObject()); err != nil { return nil, err } }