Skip to content

Commit

Permalink
refactor(kube-api-rewriter): add rewrite ownerReferences when patching
Browse files Browse the repository at this point in the history
- rename variable
- remove comments

Signed-off-by: Dmitry Lopatin <[email protected]>
  • Loading branch information
LopatinDmitr committed May 31, 2024
1 parent 208df4d commit a585260
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions images/kube-api-proxy/pkg/rewriter/rule_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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,
Expand Down

0 comments on commit a585260

Please sign in to comment.