diff --git a/pkg/kapp/diff/masked_resource.go b/pkg/kapp/diff/masked_resource.go index 66415d16f..da06eaba2 100644 --- a/pkg/kapp/diff/masked_resource.go +++ b/pkg/kapp/diff/masked_resource.go @@ -21,7 +21,7 @@ func NewMaskedResource(res ctlres.Resource, rules []ctlconf.DiffMaskRule) Masked if res == nil { panic("Expected res be non-nil") } - return MaskedResource{res.DeepCopy(), rules} + return MaskedResource{res, rules} } func (r MaskedResource) Resource() (ctlres.Resource, error) { diff --git a/pkg/kapp/diff/rebased_resource.go b/pkg/kapp/diff/rebased_resource.go index 7833a68d8..1ad53d027 100644 --- a/pkg/kapp/diff/rebased_resource.go +++ b/pkg/kapp/diff/rebased_resource.go @@ -19,13 +19,6 @@ func NewRebasedResource(existingRes, newRes ctlres.Resource, mods []ctlres.Resou panic("Expected either existingRes or newRes be non-nil") } - if existingRes != nil { - existingRes = existingRes.DeepCopy() - } - if newRes != nil { - newRes = newRes.DeepCopy() - } - return RebasedResource{existingRes: existingRes, newRes: newRes, mods: mods} } diff --git a/pkg/kapp/diff/resource_with_removed_fields.go b/pkg/kapp/diff/resource_with_removed_fields.go index 4fef24b40..c40dd9fea 100644 --- a/pkg/kapp/diff/resource_with_removed_fields.go +++ b/pkg/kapp/diff/resource_with_removed_fields.go @@ -13,9 +13,6 @@ type ResourceWithRemovedFields struct { } func NewResourceWithRemovedFields(res ctlres.Resource, mods []ctlres.FieldRemoveMod) ResourceWithRemovedFields { - if res != nil { - res = res.DeepCopy() - } return ResourceWithRemovedFields{res: res, mods: mods} } diff --git a/pkg/kapp/resources/resource_with_managed_fields.go b/pkg/kapp/resources/resource_with_managed_fields.go index c37bd099a..2aefa458e 100644 --- a/pkg/kapp/resources/resource_with_managed_fields.go +++ b/pkg/kapp/resources/resource_with_managed_fields.go @@ -9,9 +9,6 @@ type ResourceWithManagedFields struct { } func NewResourceWithManagedFields(res Resource, managedFields bool) ResourceWithManagedFields { - if res != nil { - res = res.DeepCopy() - } return ResourceWithManagedFields{res: res, managedFields: managedFields} }