mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-29 10:55:05 +00:00
add check for clone
This commit is contained in:
parent
ddbe15c6df
commit
3f965a245b
1 changed files with 13 additions and 10 deletions
|
@ -219,17 +219,20 @@ func variableSubsitutionForAttributes(gen kyverno.Generation, ctx context.EvalIn
|
|||
if newNamespace, ok := newNamespaceVar.(string); ok {
|
||||
gen.Namespace = newNamespace
|
||||
}
|
||||
// Clone
|
||||
cloneName := gen.Clone.Name
|
||||
cloneNamespace := gen.Clone.Namespace
|
||||
|
||||
newcloneNameVar := variables.SubstituteVariables(ctx, cloneName)
|
||||
if newcloneName, ok := newcloneNameVar.(string); ok {
|
||||
gen.Clone.Name = newcloneName
|
||||
}
|
||||
newcloneNamespaceVar := variables.SubstituteVariables(ctx, cloneNamespace)
|
||||
if newcloneNamespace, ok := newcloneNamespaceVar.(string); ok {
|
||||
gen.Clone.Namespace = newcloneNamespace
|
||||
if gen.Clone != (kyverno.CloneFrom{}) {
|
||||
// Clone
|
||||
cloneName := gen.Clone.Name
|
||||
cloneNamespace := gen.Clone.Namespace
|
||||
|
||||
newcloneNameVar := variables.SubstituteVariables(ctx, cloneName)
|
||||
if newcloneName, ok := newcloneNameVar.(string); ok {
|
||||
gen.Clone.Name = newcloneName
|
||||
}
|
||||
newcloneNamespaceVar := variables.SubstituteVariables(ctx, cloneNamespace)
|
||||
if newcloneNamespace, ok := newcloneNamespaceVar.(string); ok {
|
||||
gen.Clone.Namespace = newcloneNamespace
|
||||
}
|
||||
}
|
||||
return gen
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue