From bed80e482c7de628ae4001e7077210f1cb3b9574 Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Wed, 27 Sep 2017 13:14:19 +0100 Subject: [PATCH] When looking for original resource on update/delete, ignore Apiversion, use Kind and Name only Kind can change it's APIVersion with time, such as "Deployment" which was "extensions/v1beta1" and then migrated to "apps/v1beta1" in Kube 1.6. Name, Kind and optinally Namespace are used to find relevant Info object for a original resource which is being upgraded, it safe enough, as it is uniquely identifies an object. --- pkg/kube/result.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kube/result.go b/pkg/kube/result.go index 9f143feb5..87c7e6ac1 100644 --- a/pkg/kube/result.go +++ b/pkg/kube/result.go @@ -83,5 +83,5 @@ func (r Result) Intersect(rs Result) Result { // isMatchingInfo returns true if infos match on Name and GroupVersionKind. func isMatchingInfo(a, b *resource.Info) bool { - return a.Name == b.Name && a.Mapping.GroupVersionKind == b.Mapping.GroupVersionKind + return a.Name == b.Name && a.Mapping.GroupVersionKind.Kind == b.Mapping.GroupVersionKind.Kind }