Documentation
¶
Overview ¶
Package handler admission webhook handlers (hook.Handler) for various resource types.
Index ¶
- Variables
- func FormatCronJobData(o *batchv1.CronJob, settings *config.Settings) types.ResourceTags
- func NamespaceDataFormatter(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
- func NewCronJobConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewCronJobHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewCustomResourceDefinitionConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewCustomResourceDefinitionHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewDaemonSetConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewDaemonSetHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewDeploymentConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewDeploymentHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewGatewayClassConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewGatewayClassHandler(store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewGatewayConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewGatewayHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewGenericHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewIngressClassConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewIngressClassHandler(store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewIngressConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewIngressHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewJobHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewNamespaceConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewNamespaceHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewNodeConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewNodeHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewPersistentVolumeClaimConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewPersistentVolumeClaimHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewPersistentVolumeConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewPersistentVolumeHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewPodConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewPodHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewReplicaSetConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewReplicaSetHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewServiceConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewServiceHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewStatefulSetConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewStatefulSetHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NewStorageClassConfigAccessor(settings *config.Settings) config.ConfigAccessor
- func NewStorageClassHandler(store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, ...) *hook.Handler
- func NodeDataFormatter(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
- func PodDataFormatter(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
- func WorkloadDataFormatter(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
- type ConfigMapHandler
- type CronJobConfigAccessor
- func (c *CronJobConfigAccessor) AnnotationsEnabled() bool
- func (c *CronJobConfigAccessor) AnnotationsEnabledForType() bool
- func (c *CronJobConfigAccessor) LabelsEnabled() bool
- func (c *CronJobConfigAccessor) LabelsEnabledForType() bool
- func (c *CronJobConfigAccessor) ResourceType() config.ResourceType
- func (c *CronJobConfigAccessor) Settings() *config.Settings
- type CustomResourceDefinitionConfigAccessor
- func (c *CustomResourceDefinitionConfigAccessor) AnnotationsEnabled() bool
- func (c *CustomResourceDefinitionConfigAccessor) AnnotationsEnabledForType() bool
- func (c *CustomResourceDefinitionConfigAccessor) LabelsEnabled() bool
- func (c *CustomResourceDefinitionConfigAccessor) LabelsEnabledForType() bool
- func (c *CustomResourceDefinitionConfigAccessor) ResourceType() config.ResourceType
- func (c *CustomResourceDefinitionConfigAccessor) Settings() *config.Settings
- type DaemonSetConfigAccessor
- func (d *DaemonSetConfigAccessor) AnnotationsEnabled() bool
- func (d *DaemonSetConfigAccessor) AnnotationsEnabledForType() bool
- func (d *DaemonSetConfigAccessor) LabelsEnabled() bool
- func (d *DaemonSetConfigAccessor) LabelsEnabledForType() bool
- func (d *DaemonSetConfigAccessor) ResourceType() config.ResourceType
- func (d *DaemonSetConfigAccessor) Settings() *config.Settings
- type DataFormatter
- type DeploymentConfigAccessor
- func (d *DeploymentConfigAccessor) AnnotationsEnabled() bool
- func (d *DeploymentConfigAccessor) AnnotationsEnabledForType() bool
- func (d *DeploymentConfigAccessor) LabelsEnabled() bool
- func (d *DeploymentConfigAccessor) LabelsEnabledForType() bool
- func (d *DeploymentConfigAccessor) ResourceType() config.ResourceType
- func (d *DeploymentConfigAccessor) Settings() *config.Settings
- type GatewayClassConfigAccessor
- func (g *GatewayClassConfigAccessor) AnnotationsEnabled() bool
- func (g *GatewayClassConfigAccessor) AnnotationsEnabledForType() bool
- func (g *GatewayClassConfigAccessor) LabelsEnabled() bool
- func (g *GatewayClassConfigAccessor) LabelsEnabledForType() bool
- func (g *GatewayClassConfigAccessor) ResourceType() config.ResourceType
- func (g *GatewayClassConfigAccessor) Settings() *config.Settings
- type GatewayClassHandler
- type GatewayConfigAccessor
- func (g *GatewayConfigAccessor) AnnotationsEnabled() bool
- func (g *GatewayConfigAccessor) AnnotationsEnabledForType() bool
- func (g *GatewayConfigAccessor) LabelsEnabled() bool
- func (g *GatewayConfigAccessor) LabelsEnabledForType() bool
- func (g *GatewayConfigAccessor) ResourceType() config.ResourceType
- func (g *GatewayConfigAccessor) Settings() *config.Settings
- type GenericHandler
- type IngressClassConfigAccessor
- func (i *IngressClassConfigAccessor) AnnotationsEnabled() bool
- func (i *IngressClassConfigAccessor) AnnotationsEnabledForType() bool
- func (i *IngressClassConfigAccessor) LabelsEnabled() bool
- func (i *IngressClassConfigAccessor) LabelsEnabledForType() bool
- func (i *IngressClassConfigAccessor) ResourceType() config.ResourceType
- func (i *IngressClassConfigAccessor) Settings() *config.Settings
- type IngressClassHandler
- type IngressConfigAccessor
- func (i *IngressConfigAccessor) AnnotationsEnabled() bool
- func (i *IngressConfigAccessor) AnnotationsEnabledForType() bool
- func (i *IngressConfigAccessor) LabelsEnabled() bool
- func (i *IngressConfigAccessor) LabelsEnabledForType() bool
- func (i *IngressConfigAccessor) ResourceType() config.ResourceType
- func (i *IngressConfigAccessor) Settings() *config.Settings
- type JobConfigAccessor
- func (j *JobConfigAccessor) AnnotationsEnabled() bool
- func (j *JobConfigAccessor) AnnotationsEnabledForType() bool
- func (j *JobConfigAccessor) LabelsEnabled() bool
- func (j *JobConfigAccessor) LabelsEnabledForType() bool
- func (j *JobConfigAccessor) ResourceType() config.ResourceType
- func (j *JobConfigAccessor) Settings() *config.Settings
- type NamespaceConfigAccessor
- func (n *NamespaceConfigAccessor) AnnotationsEnabled() bool
- func (n *NamespaceConfigAccessor) AnnotationsEnabledForType() bool
- func (n *NamespaceConfigAccessor) LabelsEnabled() bool
- func (n *NamespaceConfigAccessor) LabelsEnabledForType() bool
- func (n *NamespaceConfigAccessor) ResourceType() config.ResourceType
- func (n *NamespaceConfigAccessor) Settings() *config.Settings
- type NodeConfigAccessor
- func (n *NodeConfigAccessor) AnnotationsEnabled() bool
- func (n *NodeConfigAccessor) AnnotationsEnabledForType() bool
- func (n *NodeConfigAccessor) LabelsEnabled() bool
- func (n *NodeConfigAccessor) LabelsEnabledForType() bool
- func (n *NodeConfigAccessor) ResourceType() config.ResourceType
- func (n *NodeConfigAccessor) Settings() *config.Settings
- type PersistentVolumeClaimConfigAccessor
- func (p *PersistentVolumeClaimConfigAccessor) AnnotationsEnabled() bool
- func (p *PersistentVolumeClaimConfigAccessor) AnnotationsEnabledForType() bool
- func (p *PersistentVolumeClaimConfigAccessor) LabelsEnabled() bool
- func (p *PersistentVolumeClaimConfigAccessor) LabelsEnabledForType() bool
- func (p *PersistentVolumeClaimConfigAccessor) ResourceType() config.ResourceType
- func (p *PersistentVolumeClaimConfigAccessor) Settings() *config.Settings
- type PersistentVolumeConfigAccessor
- func (p *PersistentVolumeConfigAccessor) AnnotationsEnabled() bool
- func (p *PersistentVolumeConfigAccessor) AnnotationsEnabledForType() bool
- func (p *PersistentVolumeConfigAccessor) LabelsEnabled() bool
- func (p *PersistentVolumeConfigAccessor) LabelsEnabledForType() bool
- func (p *PersistentVolumeConfigAccessor) ResourceType() config.ResourceType
- func (p *PersistentVolumeConfigAccessor) Settings() *config.Settings
- type PodConfigAccessor
- func (p *PodConfigAccessor) AnnotationsEnabled() bool
- func (p *PodConfigAccessor) AnnotationsEnabledForType() bool
- func (p *PodConfigAccessor) LabelsEnabled() bool
- func (p *PodConfigAccessor) LabelsEnabledForType() bool
- func (p *PodConfigAccessor) ResourceType() config.ResourceType
- func (p *PodConfigAccessor) Settings() *config.Settings
- type ReplicaSetConfigAccessor
- func (r *ReplicaSetConfigAccessor) AnnotationsEnabled() bool
- func (r *ReplicaSetConfigAccessor) AnnotationsEnabledForType() bool
- func (r *ReplicaSetConfigAccessor) LabelsEnabled() bool
- func (r *ReplicaSetConfigAccessor) LabelsEnabledForType() bool
- func (r *ReplicaSetConfigAccessor) ResourceType() config.ResourceType
- func (r *ReplicaSetConfigAccessor) Settings() *config.Settings
- type ResourceQuotaHandler
- type RoleBindingHandler
- type RoleHandler
- type SecretHandler
- type ServiceAccountHandler
- type ServiceConfigAccessor
- func (s *ServiceConfigAccessor) AnnotationsEnabled() bool
- func (s *ServiceConfigAccessor) AnnotationsEnabledForType() bool
- func (s *ServiceConfigAccessor) LabelsEnabled() bool
- func (s *ServiceConfigAccessor) LabelsEnabledForType() bool
- func (s *ServiceConfigAccessor) ResourceType() config.ResourceType
- func (s *ServiceConfigAccessor) Settings() *config.Settings
- type StatefulSetConfigAccessor
- func (s *StatefulSetConfigAccessor) AnnotationsEnabled() bool
- func (s *StatefulSetConfigAccessor) AnnotationsEnabledForType() bool
- func (s *StatefulSetConfigAccessor) LabelsEnabled() bool
- func (s *StatefulSetConfigAccessor) LabelsEnabledForType() bool
- func (s *StatefulSetConfigAccessor) ResourceType() config.ResourceType
- func (s *StatefulSetConfigAccessor) Settings() *config.Settings
- type StorageClassConfigAccessor
- func (s *StorageClassConfigAccessor) AnnotationsEnabled() bool
- func (s *StorageClassConfigAccessor) AnnotationsEnabledForType() bool
- func (s *StorageClassConfigAccessor) LabelsEnabled() bool
- func (s *StorageClassConfigAccessor) LabelsEnabledForType() bool
- func (s *StorageClassConfigAccessor) ResourceType() config.ResourceType
- func (s *StorageClassConfigAccessor) Settings() *config.Settings
- type StorageClassHandler
Constants ¶
This section is empty.
Variables ¶
var ( GatewayClassTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: types.ObservabilityMetric("gateway_types_total"), Help: "Tracks the total number of gateway class events, categorized by name and controller.", }, []string{"name", "controller"}, ) )
var ( IngressTypesTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: types.ObservabilityMetric("ingress_types_total"), Help: "Tracks the total number of ingress class events, categorized by name and controller.", }, []string{"name", "controller"}, ) )
var ( StorageInfoTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: types.ObservabilityMetric("storage_types_total"), Help: "Tracks the total number of storage class events, categorized by name and provisioner.", }, []string{"name", "provisioner"}, ) )
Functions ¶
func FormatCronJobData ¶
FormatCronJobData formats the data for a CronJob resource based on the provided settings.
func NamespaceDataFormatter ¶
func NamespaceDataFormatter(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
func NewCronJobConfigAccessor ¶
func NewCronJobConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewCronJobHandler ¶
func NewCronJobHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewCronJobHandler creates a new webhook handler for Kubernetes CronJob resources. This handler is responsible for processing CronJob objects and applying the necessary filters and transformations based on the provided settings.
Type Parameter:
- T: The type of the Kubernetes resource, which must implement the metav1.Object interface. For this handler, it should be a CronJob resource, such as *batchv1.CronJob.
Parameters:
- store: A ResourceStore instance used to manage the state of resources.
- settings: A pointer to the configuration settings that define filters and other options.
- clock: A TimeProvider instance used for time-related operations.
- resource: The CronJob resource to be processed by the handler.
Returns:
- A pointer to a hook.Handler configured for CronJob resources.
func NewCustomResourceDefinitionConfigAccessor ¶
func NewCustomResourceDefinitionConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewCustomResourceDefinitionHandler ¶
func NewCustomResourceDefinitionHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewCustomResourceDefinitionHandler creates a new webhook handler for Kubernetes CustomResourceDefinition resources.
func NewDaemonSetConfigAccessor ¶
func NewDaemonSetConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewDaemonSetHandler ¶
func NewDaemonSetHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewDaemonSetHandler creates a new webhook handler for Kubernetes DaemonSet resources. This handler is responsible for processing DaemonSet objects and applying the necessary filters and transformations based on the provided settings.
Type Parameter:
- T: The type of the Kubernetes resource, which must implement the metav1.Object interface. For this handler, it should be a DaemonSet resource, such as *appsv1.DaemonSet.
Parameters:
- store: A ResourceStore instance used to manage the state of resources.
- settings: A pointer to the configuration settings that define filters and other options.
- clock: A TimeProvider instance used for time-related operations.
- resource: The DaemonSet resource to be processed by the handler.
Returns:
- A pointer to a hook.Handler configured for DaemonSet resources.
func NewDeploymentConfigAccessor ¶
func NewDeploymentConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewDeploymentHandler ¶
func NewDeploymentHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewDeploymentHandler creates a new webhook handler for Kubernetes Deployment resources. This handler is responsible for processing Deployment objects and applying the necessary filters and transformations based on the provided settings.
Type Parameter:
- T: The type of the Kubernetes resource, which must implement the metav1.Object interface. For this handler, it should be a Deployment resource, such as *appsv1.Deployment.
Parameters:
- store: A ResourceStore instance used to manage the state of resources.
- settings: A pointer to the configuration settings that define filters and other options.
- clock: A TimeProvider instance used for time-related operations.
- resource: The Deployment resource to be processed by the handler.
Returns:
- A pointer to a hook.Handler configured for Deployment resources.
func NewGatewayClassConfigAccessor ¶
func NewGatewayClassConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewGatewayClassHandler ¶
func NewGatewayClassHandler( store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, objectType metav1.Object, ) *hook.Handler
func NewGatewayConfigAccessor ¶
func NewGatewayConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewGatewayHandler ¶
func NewGatewayHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewGatewayHandler creates a new webhook handler for Kubernetes Gateway resources.
func NewGenericHandler ¶
func NewGenericHandler[T metav1.Object]( store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, objTemplate metav1.Object, accessor config.ConfigAccessor, formatData DataFormatter, ) *hook.Handler
func NewIngressClassConfigAccessor ¶
func NewIngressClassConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewIngressClassHandler ¶
func NewIngressClassHandler( store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, objectType metav1.Object, ) *hook.Handler
func NewIngressConfigAccessor ¶
func NewIngressConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewIngressHandler ¶
func NewIngressHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewIngressHandler creates a new webhook handler for Kubernetes Ingress resources.
func NewJobHandler ¶
func NewJobHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewJobHandler creates a new webhook handler for Kubernetes Job resources. This handler is responsible for processing Job objects and applying the necessary filters and transformations based on the provided settings.
Type Parameter:
- T: The type of the Kubernetes resource, which must implement the metav1.Object interface. For this handler, it should be a Job resource, such as *batchv1.Job.
Parameters:
- store: A ResourceStore instance used to manage the state of resources.
- settings: A pointer to the configuration settings that define filters and other options.
- clock: A TimeProvider instance used for time-related operations.
- resource: The Job resource to be processed by the handler.
Returns:
- A pointer to a hook.Handler configured for Job resources.
func NewNamespaceConfigAccessor ¶
func NewNamespaceConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewNamespaceHandler ¶
func NewNamespaceHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewNamespaceHandler creates a new webhook handler for Kubernetes Namespace resources. This handler is responsible for processing Namespace objects and applying the necessary filters and transformations based on the provided settings.
Type Parameter:
- T: The type of the Kubernetes resource, which must implement the metav1.Object interface. For this handler, it should be a Namespace resource, such as *corev1.Namespace.
Parameters:
- store: A ResourceStore instance used to manage the state of resources.
- settings: A pointer to the configuration settings that define filters and other options.
- clock: A TimeProvider instance used for time-related operations.
- resource: The Namespace resource to be processed by the handler.
Returns:
- A pointer to a hook.Handler configured for Namespace resources.
func NewNodeConfigAccessor ¶
func NewNodeConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewNodeHandler ¶
func NewNodeHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewNodeHandler creates a new webhook handler for Kubernetes Node resources. This handler processes Node objects and applies filters and transformations based on the provided settings.
func NewPersistentVolumeClaimConfigAccessor ¶
func NewPersistentVolumeClaimConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewPersistentVolumeClaimHandler ¶
func NewPersistentVolumeClaimHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewPersistentVolumeClaimHandler creates a new webhook handler for Kubernetes PersistentVolumeClaim resources.
func NewPersistentVolumeConfigAccessor ¶
func NewPersistentVolumeConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewPersistentVolumeHandler ¶
func NewPersistentVolumeHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewPersistentVolumeHandler creates a new webhook handler for Kubernetes PersistentVolume resources.
func NewPodConfigAccessor ¶
func NewPodConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewPodHandler ¶
func NewPodHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
func NewReplicaSetConfigAccessor ¶
func NewReplicaSetConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewReplicaSetHandler ¶
func NewReplicaSetHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewReplicaSetHandler creates a new webhook handler for Kubernetes ReplicaSet resources. This handler is responsible for processing ReplicaSet objects and applying the necessary filters and transformations based on the provided settings.
Type Parameter:
- T: The type of the Kubernetes resource, which must implement the metav1.Object interface. For this handler, it should be a ReplicaSet resource, such as *apps/v1.ReplicaSet.
Parameters:
- store: A ResourceStore instance used to manage the state of resources.
- settings: A pointer to the configuration settings that define filters and other options.
- clock: A TimeProvider instance used for time-related operations.
- resource: The ReplicaSet resource to be processed by the handler.
Returns:
- A pointer to a hook.Handler configured for ReplicaSet resources.
func NewServiceConfigAccessor ¶
func NewServiceConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewServiceHandler ¶
func NewServiceHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewServiceHandler creates a new webhook handler for Kubernetes Service resources. This handler is responsible for processing Service objects and applying the necessary filters and transformations based on the provided settings.
Type Parameter:
- T: The type of the Kubernetes resource, which must implement the metav1.Object interface. For this handler, it should be a Service resource, such as *corev1.Service.
Parameters:
- store: A ResourceStore instance used to manage the state of resources.
- settings: A pointer to the configuration settings that define filters and other options.
- clock: A TimeProvider instance used for time-related operations.
- resource: The Service resource to be processed by the handler.
Returns:
- A pointer to a hook.Handler configured for Service resources.
func NewStatefulSetConfigAccessor ¶
func NewStatefulSetConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewStatefulSetHandler ¶
func NewStatefulSetHandler[T metav1.Object](store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, resource T) *hook.Handler
NewStatefulSetHandler creates a new webhook handler for Kubernetes StatefulSet resources. This handler is responsible for processing StatefulSet objects and applying the necessary filters and transformations based on the provided settings.
Type Parameter:
- T: The type of the Kubernetes resource, which must implement the metav1.Object interface. For this handler, it should be a StatefulSet resource, such as *apps/v1.StatefulSet, *apps/v1beta2.StatefulSet, or *apps/v1beta1.StatefulSet.
Parameters:
- store: A ResourceStore instance used to manage the state of resources.
- settings: A pointer to the configuration settings that define filters and other options.
- clock: A TimeProvider instance used for time-related operations.
- resource: The StatefulSet resource to be processed by the handler.
Returns:
- A pointer to a hook.Handler configured for StatefulSet resources.
func NewStorageClassConfigAccessor ¶
func NewStorageClassConfigAccessor(settings *config.Settings) config.ConfigAccessor
func NewStorageClassHandler ¶
func NewStorageClassHandler( store types.ResourceStore, settings *config.Settings, clock types.TimeProvider, objTemplate metav1.Object, ) *hook.Handler
func NodeDataFormatter ¶
func NodeDataFormatter(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
func PodDataFormatter ¶
func PodDataFormatter(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
func WorkloadDataFormatter ¶
func WorkloadDataFormatter(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
Types ¶
type ConfigMapHandler ¶
type ConfigMapHandler struct{} // &corev1.ConfigMap{}
type CronJobConfigAccessor ¶
type CronJobConfigAccessor struct {
// contains filtered or unexported fields
}
func (*CronJobConfigAccessor) AnnotationsEnabled ¶
func (c *CronJobConfigAccessor) AnnotationsEnabled() bool
func (*CronJobConfigAccessor) AnnotationsEnabledForType ¶
func (c *CronJobConfigAccessor) AnnotationsEnabledForType() bool
func (*CronJobConfigAccessor) LabelsEnabled ¶
func (c *CronJobConfigAccessor) LabelsEnabled() bool
func (*CronJobConfigAccessor) LabelsEnabledForType ¶
func (c *CronJobConfigAccessor) LabelsEnabledForType() bool
func (*CronJobConfigAccessor) ResourceType ¶
func (c *CronJobConfigAccessor) ResourceType() config.ResourceType
func (*CronJobConfigAccessor) Settings ¶
func (c *CronJobConfigAccessor) Settings() *config.Settings
type CustomResourceDefinitionConfigAccessor ¶
type CustomResourceDefinitionConfigAccessor struct {
// contains filtered or unexported fields
}
func (*CustomResourceDefinitionConfigAccessor) AnnotationsEnabled ¶
func (c *CustomResourceDefinitionConfigAccessor) AnnotationsEnabled() bool
func (*CustomResourceDefinitionConfigAccessor) AnnotationsEnabledForType ¶
func (c *CustomResourceDefinitionConfigAccessor) AnnotationsEnabledForType() bool
func (*CustomResourceDefinitionConfigAccessor) LabelsEnabled ¶
func (c *CustomResourceDefinitionConfigAccessor) LabelsEnabled() bool
func (*CustomResourceDefinitionConfigAccessor) LabelsEnabledForType ¶
func (c *CustomResourceDefinitionConfigAccessor) LabelsEnabledForType() bool
func (*CustomResourceDefinitionConfigAccessor) ResourceType ¶
func (c *CustomResourceDefinitionConfigAccessor) ResourceType() config.ResourceType
func (*CustomResourceDefinitionConfigAccessor) Settings ¶
func (c *CustomResourceDefinitionConfigAccessor) Settings() *config.Settings
type DaemonSetConfigAccessor ¶
type DaemonSetConfigAccessor struct {
// contains filtered or unexported fields
}
func (*DaemonSetConfigAccessor) AnnotationsEnabled ¶
func (d *DaemonSetConfigAccessor) AnnotationsEnabled() bool
func (*DaemonSetConfigAccessor) AnnotationsEnabledForType ¶
func (d *DaemonSetConfigAccessor) AnnotationsEnabledForType() bool
func (*DaemonSetConfigAccessor) LabelsEnabled ¶
func (d *DaemonSetConfigAccessor) LabelsEnabled() bool
func (*DaemonSetConfigAccessor) LabelsEnabledForType ¶
func (d *DaemonSetConfigAccessor) LabelsEnabledForType() bool
func (*DaemonSetConfigAccessor) ResourceType ¶
func (d *DaemonSetConfigAccessor) ResourceType() config.ResourceType
func (*DaemonSetConfigAccessor) Settings ¶
func (d *DaemonSetConfigAccessor) Settings() *config.Settings
type DataFormatter ¶
type DataFormatter func(accessor config.ConfigAccessor, obj metav1.Object) types.ResourceTags
type DeploymentConfigAccessor ¶
type DeploymentConfigAccessor struct {
// contains filtered or unexported fields
}
func (*DeploymentConfigAccessor) AnnotationsEnabled ¶
func (d *DeploymentConfigAccessor) AnnotationsEnabled() bool
func (*DeploymentConfigAccessor) AnnotationsEnabledForType ¶
func (d *DeploymentConfigAccessor) AnnotationsEnabledForType() bool
func (*DeploymentConfigAccessor) LabelsEnabled ¶
func (d *DeploymentConfigAccessor) LabelsEnabled() bool
func (*DeploymentConfigAccessor) LabelsEnabledForType ¶
func (d *DeploymentConfigAccessor) LabelsEnabledForType() bool
func (*DeploymentConfigAccessor) ResourceType ¶
func (d *DeploymentConfigAccessor) ResourceType() config.ResourceType
func (*DeploymentConfigAccessor) Settings ¶
func (d *DeploymentConfigAccessor) Settings() *config.Settings
type GatewayClassConfigAccessor ¶
type GatewayClassConfigAccessor struct {
// contains filtered or unexported fields
}
func (*GatewayClassConfigAccessor) AnnotationsEnabled ¶
func (g *GatewayClassConfigAccessor) AnnotationsEnabled() bool
func (*GatewayClassConfigAccessor) AnnotationsEnabledForType ¶
func (g *GatewayClassConfigAccessor) AnnotationsEnabledForType() bool
func (*GatewayClassConfigAccessor) LabelsEnabled ¶
func (g *GatewayClassConfigAccessor) LabelsEnabled() bool
func (*GatewayClassConfigAccessor) LabelsEnabledForType ¶
func (g *GatewayClassConfigAccessor) LabelsEnabledForType() bool
func (*GatewayClassConfigAccessor) ResourceType ¶
func (g *GatewayClassConfigAccessor) ResourceType() config.ResourceType
func (*GatewayClassConfigAccessor) Settings ¶
func (g *GatewayClassConfigAccessor) Settings() *config.Settings
type GatewayClassHandler ¶
func (*GatewayClassHandler) Connect ¶ added in v1.2.6
func (h *GatewayClassHandler) Connect() hook.AdmitFunc
func (*GatewayClassHandler) Create ¶
func (h *GatewayClassHandler) Create() hook.AdmitFunc
func (*GatewayClassHandler) Delete ¶ added in v1.2.6
func (h *GatewayClassHandler) Delete() hook.AdmitFunc
func (*GatewayClassHandler) Update ¶ added in v1.2.6
func (h *GatewayClassHandler) Update() hook.AdmitFunc
type GatewayConfigAccessor ¶
type GatewayConfigAccessor struct {
// contains filtered or unexported fields
}
func (*GatewayConfigAccessor) AnnotationsEnabled ¶
func (g *GatewayConfigAccessor) AnnotationsEnabled() bool
func (*GatewayConfigAccessor) AnnotationsEnabledForType ¶
func (g *GatewayConfigAccessor) AnnotationsEnabledForType() bool
func (*GatewayConfigAccessor) LabelsEnabled ¶
func (g *GatewayConfigAccessor) LabelsEnabled() bool
func (*GatewayConfigAccessor) LabelsEnabledForType ¶
func (g *GatewayConfigAccessor) LabelsEnabledForType() bool
func (*GatewayConfigAccessor) ResourceType ¶
func (g *GatewayConfigAccessor) ResourceType() config.ResourceType
func (*GatewayConfigAccessor) Settings ¶
func (g *GatewayConfigAccessor) Settings() *config.Settings
type GenericHandler ¶
type GenericHandler[T metav1.Object] struct { hook.Handler // contains filtered or unexported fields }
func (*GenericHandler[T]) Connect ¶ added in v1.2.6
func (h *GenericHandler[T]) Connect() hook.AdmitFunc
func (*GenericHandler[T]) Create ¶
func (h *GenericHandler[T]) Create() hook.AdmitFunc
func (*GenericHandler[T]) Delete ¶
func (h *GenericHandler[T]) Delete() hook.AdmitFunc
func (*GenericHandler[T]) Update ¶
func (h *GenericHandler[T]) Update() hook.AdmitFunc
type IngressClassConfigAccessor ¶
type IngressClassConfigAccessor struct {
// contains filtered or unexported fields
}
func (*IngressClassConfigAccessor) AnnotationsEnabled ¶
func (i *IngressClassConfigAccessor) AnnotationsEnabled() bool
func (*IngressClassConfigAccessor) AnnotationsEnabledForType ¶
func (i *IngressClassConfigAccessor) AnnotationsEnabledForType() bool
func (*IngressClassConfigAccessor) LabelsEnabled ¶
func (i *IngressClassConfigAccessor) LabelsEnabled() bool
func (*IngressClassConfigAccessor) LabelsEnabledForType ¶
func (i *IngressClassConfigAccessor) LabelsEnabledForType() bool
func (*IngressClassConfigAccessor) ResourceType ¶
func (i *IngressClassConfigAccessor) ResourceType() config.ResourceType
func (*IngressClassConfigAccessor) Settings ¶
func (i *IngressClassConfigAccessor) Settings() *config.Settings
type IngressClassHandler ¶
func (*IngressClassHandler) Connect ¶ added in v1.2.6
func (h *IngressClassHandler) Connect() hook.AdmitFunc
func (*IngressClassHandler) Create ¶ added in v1.2.6
func (h *IngressClassHandler) Create() hook.AdmitFunc
func (*IngressClassHandler) Delete ¶ added in v1.2.6
func (h *IngressClassHandler) Delete() hook.AdmitFunc
func (*IngressClassHandler) Update ¶ added in v1.2.6
func (h *IngressClassHandler) Update() hook.AdmitFunc
type IngressConfigAccessor ¶
type IngressConfigAccessor struct {
// contains filtered or unexported fields
}
func (*IngressConfigAccessor) AnnotationsEnabled ¶
func (i *IngressConfigAccessor) AnnotationsEnabled() bool
func (*IngressConfigAccessor) AnnotationsEnabledForType ¶
func (i *IngressConfigAccessor) AnnotationsEnabledForType() bool
func (*IngressConfigAccessor) LabelsEnabled ¶
func (i *IngressConfigAccessor) LabelsEnabled() bool
func (*IngressConfigAccessor) LabelsEnabledForType ¶
func (i *IngressConfigAccessor) LabelsEnabledForType() bool
func (*IngressConfigAccessor) ResourceType ¶
func (i *IngressConfigAccessor) ResourceType() config.ResourceType
func (*IngressConfigAccessor) Settings ¶
func (i *IngressConfigAccessor) Settings() *config.Settings
type JobConfigAccessor ¶
type JobConfigAccessor struct {
// contains filtered or unexported fields
}
func NewJobConfigAccessor ¶
func NewJobConfigAccessor(settings *config.Settings) *JobConfigAccessor
func (*JobConfigAccessor) AnnotationsEnabled ¶
func (j *JobConfigAccessor) AnnotationsEnabled() bool
func (*JobConfigAccessor) AnnotationsEnabledForType ¶
func (j *JobConfigAccessor) AnnotationsEnabledForType() bool
func (*JobConfigAccessor) LabelsEnabled ¶
func (j *JobConfigAccessor) LabelsEnabled() bool
func (*JobConfigAccessor) LabelsEnabledForType ¶
func (j *JobConfigAccessor) LabelsEnabledForType() bool
func (*JobConfigAccessor) ResourceType ¶
func (j *JobConfigAccessor) ResourceType() config.ResourceType
func (*JobConfigAccessor) Settings ¶
func (j *JobConfigAccessor) Settings() *config.Settings
type NamespaceConfigAccessor ¶
type NamespaceConfigAccessor struct {
// contains filtered or unexported fields
}
func (*NamespaceConfigAccessor) AnnotationsEnabled ¶
func (n *NamespaceConfigAccessor) AnnotationsEnabled() bool
func (*NamespaceConfigAccessor) AnnotationsEnabledForType ¶
func (n *NamespaceConfigAccessor) AnnotationsEnabledForType() bool
func (*NamespaceConfigAccessor) LabelsEnabled ¶
func (n *NamespaceConfigAccessor) LabelsEnabled() bool
func (*NamespaceConfigAccessor) LabelsEnabledForType ¶
func (n *NamespaceConfigAccessor) LabelsEnabledForType() bool
func (*NamespaceConfigAccessor) ResourceType ¶
func (n *NamespaceConfigAccessor) ResourceType() config.ResourceType
func (*NamespaceConfigAccessor) Settings ¶
func (n *NamespaceConfigAccessor) Settings() *config.Settings
type NodeConfigAccessor ¶
type NodeConfigAccessor struct {
// contains filtered or unexported fields
}
func (*NodeConfigAccessor) AnnotationsEnabled ¶
func (n *NodeConfigAccessor) AnnotationsEnabled() bool
func (*NodeConfigAccessor) AnnotationsEnabledForType ¶
func (n *NodeConfigAccessor) AnnotationsEnabledForType() bool
func (*NodeConfigAccessor) LabelsEnabled ¶
func (n *NodeConfigAccessor) LabelsEnabled() bool
func (*NodeConfigAccessor) LabelsEnabledForType ¶
func (n *NodeConfigAccessor) LabelsEnabledForType() bool
func (*NodeConfigAccessor) ResourceType ¶
func (n *NodeConfigAccessor) ResourceType() config.ResourceType
func (*NodeConfigAccessor) Settings ¶
func (n *NodeConfigAccessor) Settings() *config.Settings
type PersistentVolumeClaimConfigAccessor ¶
type PersistentVolumeClaimConfigAccessor struct {
// contains filtered or unexported fields
}
func (*PersistentVolumeClaimConfigAccessor) AnnotationsEnabled ¶
func (p *PersistentVolumeClaimConfigAccessor) AnnotationsEnabled() bool
func (*PersistentVolumeClaimConfigAccessor) AnnotationsEnabledForType ¶
func (p *PersistentVolumeClaimConfigAccessor) AnnotationsEnabledForType() bool
func (*PersistentVolumeClaimConfigAccessor) LabelsEnabled ¶
func (p *PersistentVolumeClaimConfigAccessor) LabelsEnabled() bool
func (*PersistentVolumeClaimConfigAccessor) LabelsEnabledForType ¶
func (p *PersistentVolumeClaimConfigAccessor) LabelsEnabledForType() bool
func (*PersistentVolumeClaimConfigAccessor) ResourceType ¶
func (p *PersistentVolumeClaimConfigAccessor) ResourceType() config.ResourceType
func (*PersistentVolumeClaimConfigAccessor) Settings ¶
func (p *PersistentVolumeClaimConfigAccessor) Settings() *config.Settings
type PersistentVolumeConfigAccessor ¶
type PersistentVolumeConfigAccessor struct {
// contains filtered or unexported fields
}
func (*PersistentVolumeConfigAccessor) AnnotationsEnabled ¶
func (p *PersistentVolumeConfigAccessor) AnnotationsEnabled() bool
func (*PersistentVolumeConfigAccessor) AnnotationsEnabledForType ¶
func (p *PersistentVolumeConfigAccessor) AnnotationsEnabledForType() bool
func (*PersistentVolumeConfigAccessor) LabelsEnabled ¶
func (p *PersistentVolumeConfigAccessor) LabelsEnabled() bool
func (*PersistentVolumeConfigAccessor) LabelsEnabledForType ¶
func (p *PersistentVolumeConfigAccessor) LabelsEnabledForType() bool
func (*PersistentVolumeConfigAccessor) ResourceType ¶
func (p *PersistentVolumeConfigAccessor) ResourceType() config.ResourceType
func (*PersistentVolumeConfigAccessor) Settings ¶
func (p *PersistentVolumeConfigAccessor) Settings() *config.Settings
type PodConfigAccessor ¶
type PodConfigAccessor struct {
// contains filtered or unexported fields
}
func (*PodConfigAccessor) AnnotationsEnabled ¶
func (p *PodConfigAccessor) AnnotationsEnabled() bool
func (*PodConfigAccessor) AnnotationsEnabledForType ¶
func (p *PodConfigAccessor) AnnotationsEnabledForType() bool
func (*PodConfigAccessor) LabelsEnabled ¶
func (p *PodConfigAccessor) LabelsEnabled() bool
func (*PodConfigAccessor) LabelsEnabledForType ¶
func (p *PodConfigAccessor) LabelsEnabledForType() bool
func (*PodConfigAccessor) ResourceType ¶
func (p *PodConfigAccessor) ResourceType() config.ResourceType
func (*PodConfigAccessor) Settings ¶
func (p *PodConfigAccessor) Settings() *config.Settings
type ReplicaSetConfigAccessor ¶
type ReplicaSetConfigAccessor struct {
// contains filtered or unexported fields
}
func (*ReplicaSetConfigAccessor) AnnotationsEnabled ¶
func (r *ReplicaSetConfigAccessor) AnnotationsEnabled() bool
func (*ReplicaSetConfigAccessor) AnnotationsEnabledForType ¶
func (r *ReplicaSetConfigAccessor) AnnotationsEnabledForType() bool
func (*ReplicaSetConfigAccessor) LabelsEnabled ¶
func (r *ReplicaSetConfigAccessor) LabelsEnabled() bool
func (*ReplicaSetConfigAccessor) LabelsEnabledForType ¶
func (r *ReplicaSetConfigAccessor) LabelsEnabledForType() bool
func (*ReplicaSetConfigAccessor) ResourceType ¶
func (r *ReplicaSetConfigAccessor) ResourceType() config.ResourceType
func (*ReplicaSetConfigAccessor) Settings ¶
func (r *ReplicaSetConfigAccessor) Settings() *config.Settings
type ResourceQuotaHandler ¶
type ResourceQuotaHandler struct{} // &corev1.ResourceQuota{}
type RoleBindingHandler ¶
type RoleBindingHandler struct{} // &rbacv1.RoleBinding
type RoleHandler ¶
type RoleHandler struct{} // &rbacv1.Role{}
type SecretHandler ¶
type SecretHandler struct{} // &corev1.Secret{}
SecretHandler is primarily here for completeness; we are unlikely to support secrets.
type ServiceAccountHandler ¶
type ServiceAccountHandler struct{} // &corev1.ServiceAccount{}
type ServiceConfigAccessor ¶
type ServiceConfigAccessor struct {
// contains filtered or unexported fields
}
func (*ServiceConfigAccessor) AnnotationsEnabled ¶
func (s *ServiceConfigAccessor) AnnotationsEnabled() bool
func (*ServiceConfigAccessor) AnnotationsEnabledForType ¶
func (s *ServiceConfigAccessor) AnnotationsEnabledForType() bool
func (*ServiceConfigAccessor) LabelsEnabled ¶
func (s *ServiceConfigAccessor) LabelsEnabled() bool
func (*ServiceConfigAccessor) LabelsEnabledForType ¶
func (s *ServiceConfigAccessor) LabelsEnabledForType() bool
func (*ServiceConfigAccessor) ResourceType ¶
func (s *ServiceConfigAccessor) ResourceType() config.ResourceType
func (*ServiceConfigAccessor) Settings ¶
func (s *ServiceConfigAccessor) Settings() *config.Settings
type StatefulSetConfigAccessor ¶
type StatefulSetConfigAccessor struct {
// contains filtered or unexported fields
}
func (*StatefulSetConfigAccessor) AnnotationsEnabled ¶
func (s *StatefulSetConfigAccessor) AnnotationsEnabled() bool
func (*StatefulSetConfigAccessor) AnnotationsEnabledForType ¶
func (s *StatefulSetConfigAccessor) AnnotationsEnabledForType() bool
func (*StatefulSetConfigAccessor) LabelsEnabled ¶
func (s *StatefulSetConfigAccessor) LabelsEnabled() bool
func (*StatefulSetConfigAccessor) LabelsEnabledForType ¶
func (s *StatefulSetConfigAccessor) LabelsEnabledForType() bool
func (*StatefulSetConfigAccessor) ResourceType ¶
func (s *StatefulSetConfigAccessor) ResourceType() config.ResourceType
func (*StatefulSetConfigAccessor) Settings ¶
func (s *StatefulSetConfigAccessor) Settings() *config.Settings
type StorageClassConfigAccessor ¶
type StorageClassConfigAccessor struct {
// contains filtered or unexported fields
}
func (*StorageClassConfigAccessor) AnnotationsEnabled ¶
func (s *StorageClassConfigAccessor) AnnotationsEnabled() bool
func (*StorageClassConfigAccessor) AnnotationsEnabledForType ¶
func (s *StorageClassConfigAccessor) AnnotationsEnabledForType() bool
func (*StorageClassConfigAccessor) LabelsEnabled ¶
func (s *StorageClassConfigAccessor) LabelsEnabled() bool
func (*StorageClassConfigAccessor) LabelsEnabledForType ¶
func (s *StorageClassConfigAccessor) LabelsEnabledForType() bool
func (*StorageClassConfigAccessor) ResourceType ¶
func (s *StorageClassConfigAccessor) ResourceType() config.ResourceType
func (*StorageClassConfigAccessor) Settings ¶
func (s *StorageClassConfigAccessor) Settings() *config.Settings
type StorageClassHandler ¶
func (*StorageClassHandler) Connect ¶ added in v1.2.6
func (h *StorageClassHandler) Connect() hook.AdmitFunc
func (*StorageClassHandler) Create ¶ added in v1.2.6
func (h *StorageClassHandler) Create() hook.AdmitFunc
func (*StorageClassHandler) Delete ¶ added in v1.2.6
func (h *StorageClassHandler) Delete() hook.AdmitFunc
func (*StorageClassHandler) Update ¶ added in v1.2.6
func (h *StorageClassHandler) Update() hook.AdmitFunc