1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/pkg/autogen/v2/v2.go
Charles-Edouard Brétéché a5e082303d
refactor: introduce autogen interface (#11418)
* refactor: introduce autogen interface

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix linter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-16 15:24:37 +02:00

24 lines
502 B
Go

package v2
import (
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
v1 "github.com/kyverno/kyverno/pkg/autogen/v1"
)
type v2 struct{}
func New() v2 {
return v2{}
}
func (a v2) GetAutogenRuleNames(p kyvernov1.PolicyInterface) []string {
return GetAutogenRuleNames(p)
}
func (a v2) GetAutogenKinds(p kyvernov1.PolicyInterface) []string {
return GetAutogenKinds(p)
}
func (a v2) ComputeRules(p kyvernov1.PolicyInterface, kind string) []kyvernov1.Rule {
return v1.ComputeRules(p, kind)
}