1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

Merge branch 'master' into add_testscenario

This commit is contained in:
Shuting Zhao 2020-01-10 12:00:04 -08:00
commit ac0404bd6c
3 changed files with 16 additions and 11 deletions

View file

@ -106,6 +106,8 @@ spec:
generate:
kind: ConfigMap
name: zk-kafka-address
# create the resource in the new namespace
namespace: "{{request.object.name}}"
data:
kind: ConfigMap
data:

View file

@ -76,7 +76,7 @@ spec :
- key: name # compares (key operator value)
operator: Equal
value: name # constant "name" == "name"
- key: "{{serviceAccount}}" # refer to a pre-defined variable serviceAccount
- key: "{{serviceAccountName}}" # refer to a pre-defined variable serviceAccountName
operator: NotEqual
value: "user1" # if service
# Each rule can contain a single validate, mutate, or generate directive

View file

@ -232,6 +232,8 @@ func variableSubsitutionForAttributes(gen kyverno.Generation, ctx context.EvalIn
if newNamespace, ok := newNamespaceVar.(string); ok {
gen.Namespace = newNamespace
}
if gen.Clone != (kyverno.CloneFrom{}) {
// Clone
cloneName := gen.Clone.Name
cloneNamespace := gen.Clone.Namespace
@ -244,6 +246,7 @@ func variableSubsitutionForAttributes(gen kyverno.Generation, ctx context.EvalIn
if newcloneNamespace, ok := newcloneNamespaceVar.(string); ok {
gen.Clone.Namespace = newcloneNamespace
}
}
return gen
}