admission

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Data sourceAuthorityType = "Data" // only data type is supported
)

Variables

This section is empty.

Functions

func IsPolicyServerNotReady

func IsPolicyServerNotReady(err error) bool

IsPolicyServerNotReady returns true when the given error is of type PolicyServerNotReadyError

Types

type PolicyConfigEntryMap added in v0.5.2

type PolicyConfigEntryMap map[string]PolicyServerConfigEntry

func (PolicyConfigEntryMap) ToAdmissionPolicyReconcileRequests added in v0.5.2

func (policyConfigEntryMap PolicyConfigEntryMap) ToAdmissionPolicyReconcileRequests() []reconcile.Request

func (PolicyConfigEntryMap) ToClusterAdmissionPolicyReconcileRequests added in v0.5.2

func (policyConfigEntryMap PolicyConfigEntryMap) ToClusterAdmissionPolicyReconcileRequests() []reconcile.Request

type PolicyServerConfigEntry added in v0.5.2

type PolicyServerConfigEntry struct {
	NamespacedName        types.NamespacedName              `json:"namespacedName"`
	URL                   string                            `json:"url"`
	PolicyMode            string                            `json:"policyMode"`
	AllowedToMutate       bool                              `json:"allowedToMutate"`
	ContextAwareResources []policiesv1.ContextAwareResource `json:"contextAwareResources,omitempty"`
	Settings              runtime.RawExtension              `json:"settings,omitempty"`
}

type PolicyServerNotReadyError

type PolicyServerNotReadyError struct {
	Message string
}

PolicyServerNotReadyError error is raised when the PolicyServer deployment is not yet ready

func (*PolicyServerNotReadyError) Error

func (e *PolicyServerNotReadyError) Error() string

Error returns a human description of the error

func (*PolicyServerNotReadyError) PolicyServerNotReady

func (e *PolicyServerNotReadyError) PolicyServerNotReady() bool

PolicyServerNotReady returns true if the error is a NoVersionFoundError instance

type Reconciler

type Reconciler struct {
	Client                                             client.Client
	APIReader                                          client.Reader
	DeploymentsNamespace                               string
	AlwaysAcceptAdmissionReviewsInDeploymentsNamespace bool
	Log                                                logr.Logger
	MetricsEnabled                                     bool
	TracingEnabled                                     bool
}

func (*Reconciler) GetPolicies added in v0.5.2

func (r *Reconciler) GetPolicies(ctx context.Context, policyServer *policiesv1.PolicyServer) ([]policiesv1.Policy, error)

GetPolicies returns all admission policies and cluster admission policies bound to the given policyServer

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(
	ctx context.Context,
	policyServer *policiesv1.PolicyServer,
	policies []policiesv1.Policy,
) error

func (*Reconciler) ReconcileDeletion

func (r *Reconciler) ReconcileDeletion(
	ctx context.Context,
	policyServer *policiesv1.PolicyServer,
) error

func (*Reconciler) ReconcileMutatingWebhookConfiguration added in v0.5.2

func (r *Reconciler) ReconcileMutatingWebhookConfiguration(
	ctx context.Context,
	policy policiesv1.Policy,
	admissionSecret *corev1.Secret,
	policyServerNameWithPrefix string,
) error

func (*Reconciler) ReconcileValidatingWebhookConfiguration added in v0.5.2

func (r *Reconciler) ReconcileValidatingWebhookConfiguration(
	ctx context.Context,
	policy policiesv1.Policy,
	admissionSecret *corev1.Secret,
	policyServerNameWithPrefix string,
) error

Jump to

Keyboard shortcuts

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