Documentation ¶
Index ¶
- Constants
- Variables
- func GetOwnerReferences(resources []unstructured.Unstructured, item unstructured.Unstructured) ([]metav1.OwnerReference, error)
- func GetPods(resources []unstructured.Unstructured) []unstructured.Unstructured
- func GetViolationsGroupedByResource(violations []Violation) [][]Violation
- func IndexFunc[E any](s []E, f func(E) bool) int
- func IsExempt(resource unstructured.Unstructured) bool
- type AbortFunc
- type FileSystemContextKeyType
- type Validator
- type Violation
- type ViolationTarget
Constants ¶
View Source
const ( KIND_POD = "Pod" KIND_REPLICATION_CONTROLLER = "ReplicationController" KIND_DEPLOYMENT = "Deployment" KIND_REPLICA_SET = "ReplicaSet" KIND_DAEMON_SET = "DaemonSet" KIND_STATEFUL_SET = "StatefulSet" KIND_JOB = "Job" KIND_CRON_JOB = "CronJob" )
Variables ¶
View Source
var ( ExemptPodLabelName = "resources.gardener.cloud/managed-by" ExemptPodLabelValue = "gardener" )
Functions ¶
func GetOwnerReferences ¶
func GetOwnerReferences(resources []unstructured.Unstructured, item unstructured.Unstructured) ([]metav1.OwnerReference, error)
func GetPods ¶
func GetPods(resources []unstructured.Unstructured) []unstructured.Unstructured
func IsExempt ¶
func IsExempt(resource unstructured.Unstructured) bool
Types ¶
type FileSystemContextKeyType ¶
type FileSystemContextKeyType string
const FileSystemContextKey FileSystemContextKeyType = "fs"
type Validator ¶
type Validator interface { /* The return violations slice is non-nil if invalid resources were found The return error is non-nil if another type of error was encountered */ Validate(resources []unstructured.Unstructured) (violations []Violation, err error) GetName() string }
type Violation ¶
type Violation struct { Message string // an error describing the violation Resource *unstructured.Unstructured // the violating resource Level int // verbosity level: 0 is the most severe ValidatorName string }
func NewViolation ¶
func NewViolation(resource unstructured.Unstructured, message string, level int, validatorName string) Violation
Click to show internal directories.
Click to hide internal directories.