mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
a5e082303d
* 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>
19 lines
498 B
Go
19 lines
498 B
Go
package autogen
|
|
|
|
import (
|
|
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
|
autogenv1 "github.com/kyverno/kyverno/pkg/autogen/v1"
|
|
autogenv2 "github.com/kyverno/kyverno/pkg/autogen/v2"
|
|
)
|
|
|
|
type Autogen interface {
|
|
GetAutogenRuleNames(kyvernov1.PolicyInterface) []string
|
|
GetAutogenKinds(kyvernov1.PolicyInterface) []string
|
|
ComputeRules(kyvernov1.PolicyInterface, string) []kyvernov1.Rule
|
|
}
|
|
|
|
var (
|
|
V1 Autogen = autogenv1.New()
|
|
V2 Autogen = autogenv2.New()
|
|
Default Autogen = V1
|
|
)
|