From 2a5c25aca58933c4179e43134e0faf36e8c1d7c1 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Tue, 23 Apr 2019 15:17:07 -0400 Subject: [PATCH] Copy object sent to validating admission --- pkg/registry/core/pod/storage/eviction.go | 2 +- pkg/registry/core/pod/storage/storage.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 } }