1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/pkg/autogen/autogen.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

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
)