|
|
|
|
@ -79,7 +79,14 @@ func (r ResourceList) Intersect(rs ResourceList) ResourceList {
|
|
|
|
|
return r.Filter(rs.Contains)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// isMatchingInfo returns true if infos match on Name and GroupVersionKind.
|
|
|
|
|
// isMatchingInfo returns true if infos match on Name, Namespace, Group and Kind.
|
|
|
|
|
//
|
|
|
|
|
// IMPORTANT: Version is intentionally excluded from the comparison. Resources
|
|
|
|
|
// served by the same CRD at different API versions (e.g. v2beta1 vs v2beta2)
|
|
|
|
|
// share the same underlying storage in the Kubernetes API server. Comparing
|
|
|
|
|
// the full GroupVersionKind causes Difference() to treat a version change as
|
|
|
|
|
// a resource removal + addition, which makes Helm delete the resource it just
|
|
|
|
|
// created during upgrades. See https://github.com/helm/helm/issues/31768
|
|
|
|
|
func isMatchingInfo(a, b *resource.Info) bool {
|
|
|
|
|
return a.Name == b.Name && a.Namespace == b.Namespace && a.Mapping.GroupVersionKind == b.Mapping.GroupVersionKind
|
|
|
|
|
return a.Name == b.Name && a.Namespace == b.Namespace && a.Mapping.GroupVersionKind.GroupKind() == b.Mapping.GroupVersionKind.GroupKind()
|
|
|
|
|
}
|
|
|
|
|
|