mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-05 15:37:19 +00:00
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
30 lines
938 B
Go
30 lines
938 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
|
|
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
|
enginecontext "github.com/kyverno/kyverno/pkg/engine/context"
|
|
"github.com/kyverno/kyverno/pkg/engine/jmespath"
|
|
)
|
|
|
|
type RegistryClientFactory interface {
|
|
GetClient(ctx context.Context, creds *kyvernov1.ImageRegistryCredentials) (RegistryClient, error)
|
|
}
|
|
|
|
type Initializer = func(jsonContext enginecontext.Interface) error
|
|
|
|
// ContextLoaderFactory provides a ContextLoader given a policy context and rule name
|
|
type ContextLoaderFactory = func(policy kyvernov1.PolicyInterface, rule kyvernov1.Rule) ContextLoader
|
|
|
|
// ContextLoader abstracts the mechanics to load context entries in the underlying json context
|
|
type ContextLoader interface {
|
|
Load(
|
|
ctx context.Context,
|
|
jp jmespath.Interface,
|
|
client RawClient,
|
|
rclientFactory RegistryClientFactory,
|
|
contextEntries []kyvernov1.ContextEntry,
|
|
jsonContext enginecontext.Interface,
|
|
) error
|
|
}
|