From a5852605a2a887cff47c70ee830c7642b3e0be1d Mon Sep 17 00:00:00 2001 From: Dmitry Lopatin Date: Fri, 31 May 2024 13:11:56 +0300 Subject: [PATCH] refactor(kube-api-rewriter): add rewrite ownerReferences when patching - rename variable - remove comments Signed-off-by: Dmitry Lopatin --- images/kube-api-proxy/pkg/rewriter/rule_rewriter.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/images/kube-api-proxy/pkg/rewriter/rule_rewriter.go b/images/kube-api-proxy/pkg/rewriter/rule_rewriter.go index 28475f34e..75d7d687e 100644 --- a/images/kube-api-proxy/pkg/rewriter/rule_rewriter.go +++ b/images/kube-api-proxy/pkg/rewriter/rule_rewriter.go @@ -200,10 +200,6 @@ func (rw *RuleBasedRewriter) RewriteJSONPayload(targetReq *TargetRequest, obj [] return obj, err } - // if targetReq.IsCore() || shouldRewriteOwnerReferences(kind) { - // rwrBytes, err = RewriteOwnerReferences(rw.Rules, rwrBytes, action) - // } - return rwrBytes, nil } @@ -223,8 +219,8 @@ func (rw *RuleBasedRewriter) RewritePatch(targetReq *TargetRequest, obj []byte) return obj, nil } -func shouldRewriteOwnerReferences(kind string) bool { - switch kind { +func shouldRewriteOwnerReferences(resourceType string) bool { + switch resourceType { case CRDKind, CRDListKind, RoleKind, RoleListKind, RoleBindingKind, RoleBindingListKind,