Help us shape the future of Go! Take the 2026 Go Developer Survey

events

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionCordoned       string = "Cordoned"
	ActionUncordoned     string = "UnCordoned"
	ActionReconciled     string = "Reconciled"
	ActionDisassociating string = "Disassociating"

	ActionMutated          string = "Mutated"
	ActionValidationDenied string = "ValidationDenied"
	ActionRuleAudit        string = "RuleAudit"

	ActionExpired       string = "Expired"
	ActionActivated     string = "Activated"
	ActionPendingReview string = "PendingReview"
	ActionApproved      string = "Approved"
	ActionDenied        string = "Denied"
)
View Source
const (
	ReasonForbiddenNetworkPolicyIngressCIDR = "ForbiddenNetworkPolicyIngressCIDR"
	ReasonForbiddenNetworkPolicyEgressCIDR  = "ForbiddenNetworkPolicyEgressCIDR"
	// Generic.
	ReasonTenantResourceWriteOp string = "TenantResourceWriteOp"
	ReasonOverprovision         string = "Overprovisioned"
	ReasonCordoning             string = "Cordoned"

	// ForbiddenLabelReason used as reason string to deny forbidden labels.
	ReasonForbiddenLabel string = "ForbiddenLabel"
	// ForbiddenAnnotationReason used as reason string to deny forbidden annotations.
	ReasonForbiddenAnnotation string = "ForbiddenAnnotation"
	ReasonForbiddenMetadata   string = "ForbiddenMetadata"

	ReasonAdmissionFailure string = "AdmissionFailed"

	// RuleStatus.
	ReasonNamespaceRuleAudit        string = "NamespaceRuleAudit"
	ReasonForbiddenWorkloadType     string = "ForbiddenWorkloadType"
	ReasonForbiddenDisruptionBudget string = "ForbiddenDisruptionBudget"
	// Namespace.
	ReasonNamespaceHijack string = "ReasonNamespacePatch"

	// Tenant.
	ReasonTenantDefaulted     string = "TenantDefaulted"
	ReasonTenantAssigned      string = "TenantAssigned"
	ReasonInvalidTenantPrefix string = "InvalidTenantPrefix"
	ReasonPromotionDenied     string = "ReasonPromotionDenied"

	// Classes.
	ReasonMissingStorageClass    string = "MissingStorageClass"
	ReasonForbiddenStorageClass  string = "ForbiddenStorageClass"
	ReasonForbiddenPriorityClass string = "ForbiddenPriorityClass"
	ReasonForbiddenRuntimeClass  string = "ForbiddenRuntimeClass"
	ReasonForbiddenIngressClass  string = "ForbiddenIngressClass"
	ReasonMissingIngressClass    string = "MissingIngressClass"
	ReasonForbiddenGatewayClass  string = "ForbiddenGatewayClass"
	ReasonMissingGatewayClass    string = "MissingGatewayClass"
	ReasonMissingDeviceClass     string = "MissingDeviceClass"
	ReasonForbiddenDeviceClass   string = "ForbiddenDeviceClass"

	// Nodes.
	ReasonForbiddenNodeSelectorUpdate string = "ForbiddenNodeSelectorUpdate"

	// Pods.
	ReasonMissingFQCI                string = "MissingFQCI"
	ReasonForbiddenContainerRegistry string = "ForbiddenContainerRegistry"
	ReasonForbiddenPullPolicy        string = "ForbiddenPullPolicy"
	ReasonForbiddenPodQoSClass       string = "ForbiddenQoSClass"
	ReasonForbiddenPodScheduler      string = "ForbiddenScheduler"
	ReasonForbiddenPodResources      string = "ForbiddenPodResources"
	ReasonForbiddenPodNodeSelector   string = "ForbiddenPodNodeSelector"
	ReasonForbiddenPodToleration     string = "ForbiddenPodToleration"
	ReasonForbiddenPodTopologySpread string = "ForbiddenPodTopologySpread"
	ReasonForbiddenPodAffinity       string = "ForbiddenPodAffinity"
	ReasonForbiddenSeccompProfile    string = "ForbiddenSeccompProfile"
	ReasonForbiddenAppArmorProfile   string = "ForbiddenAppArmorProfile"

	// Ingress.
	ReasonWildcardDenied           string = "WildcardDenied"
	ReasonIngressHostnameNotValid  string = "IngressHostnameNotValid"
	ReasonIngressHostnameEmpty     string = "IngressHostnameEmpty"
	ReasonIngressHostnameCollision string = "IngressHostnameCollision"
	ReasonForbiddenIngressHostname string = "ForbiddenIngressHostname"

	// Services.
	ReasonForbiddenExternalServiceIP string = "ForbiddenExternalServiceIP"
	ReasonForbiddenLoadBalancer      string = "ForbiddenLoadBalancer"
	ReasonForbiddenExternalName      string = "ForbiddenExternalName"
	ReasonForbiddenNodePort          string = "ForbiddenNodePort"
	ReasonForbiddenServiceType       string = "ForbiddenServiceType"
	ReasonForbiddenLoadBalancerCIDR  string = "ForbiddenLoadBalancerCIDR"

	// Storage.
	ReasonCrossTenantReference string = "CrossTenantReference"

	// ResourcePools.
	ReasonDisassociated string = "Disassociated"

	// CustomQuotas.
	ReasonUsageCalculationFailed = "UsageCalculationFailed"
	ReasonQuotaExceeded          = "QuotaExceeded"
)
View Source
const (
	ReportingController = "controller.projectcapsule.dev"
	ReportingInstance   = "capsule-admission"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRecorder added in v0.13.7

type EventRecorder interface {
	k8sevents.EventRecorder
	LabeledEvent(regarding runtime.Object, eventType string, reason string, action string, note string) LabeledEvent
}

func NewDiscardRecorder added in v0.15.0

func NewDiscardRecorder() EventRecorder

NewDiscardRecorder returns a recorder that never publishes Events. It is safe to share across requests; each labeled event retains its own metadata.

func NewEventRecorder added in v0.13.7

func NewEventRecorder(
	c client.Client,
	log logr.Logger,
	recorder k8sevents.EventRecorder,
	configuration configuration.Configuration,
) EventRecorder

type LabeledEvent added in v0.13.7

type LabeledEvent interface {
	Emit(ctx context.Context)
	WithRelated(obj runtime.Object) LabeledEvent
	WithLabels(labels map[string]string) LabeledEvent
	WithAnnotations(annotations map[string]string) LabeledEvent
	WithTenantLabel(tnt *capsulev1beta2.Tenant) LabeledEvent
	WithRequestAnnotations(req admission.Request) LabeledEvent

	Reason() string
	Action() string
	Regarding() runtime.Object
	Labels() map[string]string
	Annotations() map[string]string
	Note() string
	EventType() string
	Related() runtime.Object
}

Jump to

Keyboard shortcuts

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