internal

package
v1.11.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Context = context.Background()

Functions

func CheckCacheSync

func CheckCacheSync[T comparable](logger logr.Logger, status map[T]bool) bool

func CreateAggregatorClient added in v1.10.0

func CreateAggregatorClient(logger logr.Logger, opts ...agg.NewOption) aggregator.Interface

func ExceptionNamespace added in v1.10.0

func ExceptionNamespace() string

func LeaderElectionRetryPeriod added in v1.10.0

func LeaderElectionRetryPeriod() time.Duration

func NewConfigMapResolver added in v1.10.0

func NewConfigMapResolver(
	ctx context.Context,
	logger logr.Logger,
	kubeClient kubernetes.Interface,
	resyncPeriod time.Duration,
) engineapi.ConfigmapResolver

func NewEngine added in v1.10.0

func NewEngine(
	ctx context.Context,
	logger logr.Logger,
	configuration config.Configuration,
	metricsConfiguration config.MetricsConfiguration,
	jp jmespath.Interface,
	client dclient.Interface,
	rclient registryclient.Client,
	ivCache imageverifycache.Client,
	kubeClient kubernetes.Interface,
	kyvernoClient versioned.Interface,
	secretLister corev1listers.SecretNamespaceLister,
	apiCallConfig apicall.APICallConfiguration,
) engineapi.Engine

func NewExceptionSelector added in v1.10.0

func NewExceptionSelector(
	ctx context.Context,
	logger logr.Logger,
	kyvernoClient versioned.Interface,
	resyncPeriod time.Duration,
) engineapi.PolicyExceptionSelector

func ParseFlags

func ParseFlags(config Configuration, opts ...Option)

func PolicyExceptionEnabled added in v1.10.0

func PolicyExceptionEnabled() bool

func SetupMetrics

func SetupMetrics(ctx context.Context, logger logr.Logger, metricsConfiguration config.MetricsConfiguration, kubeClient kubernetes.Interface) (metrics.MetricsConfigManager, context.CancelFunc)

func SetupTracing

func SetupTracing(logger logr.Logger, name string, kubeClient kubernetes.Interface) context.CancelFunc

func StartInformers

func StartInformers[T startable](ctx context.Context, informers ...T)

func StartInformersAndWaitForCacheSync

func StartInformersAndWaitForCacheSync(ctx context.Context, logger logr.Logger, informers ...informer) bool

func WaitForCacheSync

func WaitForCacheSync(ctx context.Context, logger logr.Logger, informers ...informer) bool

Types

type Configuration

type Configuration interface {
	UsesMetrics() bool
	UsesTracing() bool
	UsesProfiling() bool
	UsesKubeconfig() bool
	UsesPolicyExceptions() bool
	UsesConfigMapCaching() bool
	UsesDeferredLoading() bool
	UsesCosign() bool
	UsesRegistryClient() bool
	UsesImageVerifyCache() bool
	UsesLeaderElection() bool
	UsesKyvernoClient() bool
	UsesDynamicClient() bool
	UsesApiServerClient() bool
	UsesMetadataClient() bool
	UsesKyvernoDynamicClient() bool
	FlagSets() []*flag.FlagSet
}

func NewConfiguration

func NewConfiguration(options ...ConfigurationOption) Configuration

type ConfigurationOption

type ConfigurationOption func(c *configuration)

func WithApiServerClient added in v1.10.0

func WithApiServerClient() ConfigurationOption

func WithConfigMapCaching added in v1.10.0

func WithConfigMapCaching() ConfigurationOption

func WithCosign added in v1.10.0

func WithCosign() ConfigurationOption

func WithDeferredLoading added in v1.10.1

func WithDeferredLoading() ConfigurationOption

func WithDynamicClient added in v1.10.0

func WithDynamicClient() ConfigurationOption

func WithFlagSets

func WithFlagSets(flagsets ...*flag.FlagSet) ConfigurationOption

func WithImageVerifyCache added in v1.10.5

func WithImageVerifyCache() ConfigurationOption

func WithKubeconfig

func WithKubeconfig() ConfigurationOption

func WithKyvernoClient added in v1.10.0

func WithKyvernoClient() ConfigurationOption

func WithKyvernoDynamicClient added in v1.10.0

func WithKyvernoDynamicClient() ConfigurationOption

func WithLeaderElection added in v1.10.0

func WithLeaderElection() ConfigurationOption

func WithMetadataClient added in v1.10.0

func WithMetadataClient() ConfigurationOption

func WithMetrics

func WithMetrics() ConfigurationOption

func WithPolicyExceptions added in v1.10.0

func WithPolicyExceptions() ConfigurationOption

func WithProfiling

func WithProfiling() ConfigurationOption

func WithRegistryClient added in v1.10.0

func WithRegistryClient() ConfigurationOption

func WithTracing

func WithTracing() ConfigurationOption

type Controller

type Controller interface {
	Run(context.Context, logr.Logger, *sync.WaitGroup)
}

func NewController

func NewController(name string, c controllers.Controller, w int) Controller

type Option added in v1.10.0

type Option = func(*options)

func WithDefaultBurst added in v1.10.0

func WithDefaultBurst(burst int) Option

func WithDefaultQps added in v1.10.0

func WithDefaultQps(qps float64) Option

type SetupResult added in v1.10.0

type SetupResult struct {
	Logger                 logr.Logger
	Configuration          config.Configuration
	MetricsConfiguration   config.MetricsConfiguration
	MetricsManager         metrics.MetricsConfigManager
	Jp                     jmespath.Interface
	KubeClient             kubeclient.UpstreamInterface
	LeaderElectionClient   kubeclient.UpstreamInterface
	RegistryClient         registryclient.Client
	ImageVerifyCacheClient imageverifycache.Client
	RegistrySecretLister   corev1listers.SecretNamespaceLister
	KyvernoClient          kyvernoclient.UpstreamInterface
	DynamicClient          dynamicclient.UpstreamInterface
	ApiServerClient        apiserverclient.UpstreamInterface
	MetadataClient         metadataclient.UpstreamInterface
	KyvernoDynamicClient   dclient.Interface
}

func Setup

func Setup(config Configuration, name string, skipResourceFilters bool) (context.Context, SetupResult, context.CancelFunc)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL