mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
bug fix - nil pointer (#1093)
* add watch policy to clusterrole kyverno:customresources * fix build * fix nil pointer
This commit is contained in:
parent
b319a816c5
commit
9a210e24d9
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@ package policymutation
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/go-logr/logr"
|
||||
|
@ -20,6 +21,10 @@ func generateCronJobRule(rule kyverno.Rule, controllers string, log logr.Logger)
|
|||
logger.V(3).Info("")
|
||||
jobRule := generateRuleForControllers(rule, "Job", logger)
|
||||
|
||||
if reflect.DeepEqual(jobRule, kyvernoRule{}) {
|
||||
return kyvernoRule{}
|
||||
}
|
||||
|
||||
cronJobRule := &jobRule
|
||||
cronJobRule.Name = fmt.Sprintf("autogen-cronjob-%s", rule.Name)
|
||||
cronJobRule.MatchResources.Kinds = []string{engine.PodControllerCronJob}
|
||||
|
|
Loading…
Reference in a new issue