1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

remove unused code

This commit is contained in:
Shuting Zhao 2020-05-21 08:49:33 -07:00
parent 2dda3e2a42
commit 3952aa5550

View file

@ -2,7 +2,6 @@ package engine
import (
"encoding/json"
"reflect"
"strings"
"time"
@ -96,15 +95,11 @@ func Mutate(policyContext PolicyContext) (resp response.EngineResponse) {
resp.PolicyResponse.Rules = append(resp.PolicyResponse.Rules, ruleResponse)
incrementAppliedRuleCount(&resp)
}
// insert annotation to podtemplate if resource is pod controller
// skip inserting on existing resource
if reflect.DeepEqual(policyContext.AdmissionInfo, kyverno.RequestInfo{}) {
continue
}
}
if strings.Contains(PodControllers, resource.GetKind()) {
pocliyAnnotation := policy.GetAnnotations()
givenPodControllers := pocliyAnnotation[PodControllersAnnotation]
if strings.Contains(givenPodControllers, resource.GetKind()) {
if !patchedResourceHasPodControllerAnnotation(patchedResource) {
var ruleResponse response.RuleResponse
ruleResponse, patchedResource = mutate.ProcessOverlay(logger, "podControllerAnnotation", podTemplateRule.Mutation.Overlay, patchedResource)