scrub

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scrubers added in v0.20.0

func Scrubers() map[internal.R]ScrubFn

Scrubers return a collection of linter scrubbers.

Types

type Cache added in v0.3.5

type Cache struct {
	Config *config.Config
	DB     *db.DB
	Loader *db.Loader
	// contains filtered or unexported fields
}

Cache tracks commonly used resources.

func NewCache added in v0.3.5

func NewCache(dba *db.DB, f types.Factory, c *config.Config) *Cache

type Cluster added in v0.4.0

type Cluster struct {
	*issues.Collector
	*cache.Cluster
	*config.Config
	// contains filtered or unexported fields
}

Cluster represents a Cluster scruber.

func (*Cluster) HasMetrics added in v0.11.2

func (d *Cluster) HasMetrics() bool

func (*Cluster) Lint added in v0.20.0

func (d *Cluster) Lint(ctx context.Context) error

Lint all available Clusters.

func (*Cluster) Preloads added in v0.20.0

func (d *Cluster) Preloads() Preloads

type ClusterRole added in v0.6.0

type ClusterRole struct {
	*issues.Collector
	*Cache
}

ClusterRole represents a ClusterRole scruber.

func (*ClusterRole) Lint added in v0.20.0

func (s *ClusterRole) Lint(ctx context.Context) error

Lint all available ClusterRoles.

func (*ClusterRole) Preloads added in v0.20.0

func (s *ClusterRole) Preloads() Preloads

type ClusterRoleBinding added in v0.6.0

type ClusterRoleBinding struct {
	*issues.Collector
	*Cache
}

ClusterRoleBinding represents a ClusterRoleBinding scruber.

func (*ClusterRoleBinding) Lint added in v0.20.0

func (s *ClusterRoleBinding) Lint(ctx context.Context) error

Lint all available ClusterRoleBindings.

func (*ClusterRoleBinding) Preloads added in v0.20.0

func (s *ClusterRoleBinding) Preloads() Preloads

type Collector

type Collector interface {
	MaxSeverity(res string) rules.Level
	Outcome() issues.Outcome
}

Collector collects sanitization issues.

type ConfigMap

type ConfigMap struct {
	*issues.Collector
	*Cache
}

ConfigMap represents a configMap scruber.

func (*ConfigMap) Lint added in v0.20.0

func (s *ConfigMap) Lint(ctx context.Context) error

Lint all available ConfigMaps.

func (*ConfigMap) Preloads added in v0.20.0

func (s *ConfigMap) Preloads() Preloads

type CronJob added in v0.20.0

type CronJob struct {
	*issues.Collector
	*Cache
}

CronJob represents a CronJob scruber.

func (*CronJob) Lint added in v0.20.0

func (s *CronJob) Lint(ctx context.Context) error

Lint all available CronJobs.

func (*CronJob) Preloads added in v0.20.0

func (s *CronJob) Preloads() Preloads

type DaemonSet added in v0.4.0

type DaemonSet struct {
	*issues.Collector
	*Cache
}

DaemonSet represents a DaemonSet scruber.

func (*DaemonSet) Lint added in v0.20.0

func (s *DaemonSet) Lint(ctx context.Context) error

Lint all available DaemonSets.

func (*DaemonSet) Preloads added in v0.20.0

func (s *DaemonSet) Preloads() Preloads

type Deployment

type Deployment struct {
	*issues.Collector
	*Cache
}

Deployment represents a Deployment scruber.

func (*Deployment) Lint added in v0.20.0

func (s *Deployment) Lint(ctx context.Context) error

Lint all available Deployments.

func (*Deployment) Preloads added in v0.20.0

func (s *Deployment) Preloads() Preloads

type Gateway added in v0.20.0

type Gateway struct {
	*issues.Collector
	*Cache
}

Gateway represents a Gateway scruber.

func (*Gateway) Lint added in v0.20.0

func (s *Gateway) Lint(ctx context.Context) error

Lint all available Gateway.

func (*Gateway) Preloads added in v0.20.0

func (s *Gateway) Preloads() Preloads

type GatewayClass added in v0.20.0

type GatewayClass struct {
	*issues.Collector
	*Cache
}

GatewayClass represents a GatewayClass scruber.

func (*GatewayClass) Lint added in v0.20.0

func (s *GatewayClass) Lint(ctx context.Context) error

Lint all available GatewayClass.

func (*GatewayClass) Preloads added in v0.20.0

func (s *GatewayClass) Preloads() Preloads

type HTTPRoute added in v0.20.0

type HTTPRoute struct {
	*issues.Collector
	*Cache
}

HTTPRoute represents a HTTPRoute scruber.

func (*HTTPRoute) Lint added in v0.20.0

func (s *HTTPRoute) Lint(ctx context.Context) error

Lint all available HTTPRoute.

func (*HTTPRoute) Preloads added in v0.20.0

func (s *HTTPRoute) Preloads() Preloads

type HorizontalPodAutoscaler

type HorizontalPodAutoscaler struct {
	*issues.Collector
	*Cache
}

HorizontalPodAutoscaler represents a HorizontalPodAutoscaler scruber.

func (*HorizontalPodAutoscaler) Lint added in v0.20.0

Lint all available HorizontalPodAutoscalers.

func (*HorizontalPodAutoscaler) Preloads added in v0.20.0

func (s *HorizontalPodAutoscaler) Preloads() Preloads

type Ingress added in v0.4.0

type Ingress struct {
	*issues.Collector
	*Cache
}

Ingress represents a Ingress scruber.

func (*Ingress) Lint added in v0.20.0

func (s *Ingress) Lint(ctx context.Context) error

Lint all available Ingress.

func (*Ingress) Preloads added in v0.20.0

func (s *Ingress) Preloads() Preloads

type Job added in v0.20.0

type Job struct {
	*issues.Collector
	*Cache
}

Job represents a Job scruber.

func (*Job) Lint added in v0.20.0

func (s *Job) Lint(ctx context.Context) error

Lint all available Jobs.

func (*Job) Preloads added in v0.20.0

func (s *Job) Preloads() Preloads

type Linter added in v0.20.0

type Linter interface {
	// Collector tracks issues.
	Collector

	// Lint runs checks on a resource.
	Lint(context.Context) error

	// Preloads Preloads resource requirements.
	Preloads() Preloads
}

Linter represents a resource linter.

func NewCluster added in v0.4.0

func NewCluster(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewCluster returns a new instance.

func NewClusterRole added in v0.6.0

func NewClusterRole(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewClusterRole returns a new instance.

func NewClusterRoleBinding added in v0.6.0

func NewClusterRoleBinding(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewClusterRoleBinding returns a new instance.

func NewConfigMap

func NewConfigMap(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewConfigMap returns a new instance.

func NewCronJob added in v0.20.0

func NewCronJob(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewCronJob return a new instance.

func NewDaemonSet added in v0.4.0

func NewDaemonSet(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewDaemonSet return a new instance.

func NewDeployment

func NewDeployment(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewDeployment returns a new instance.

func NewGateway added in v0.20.0

func NewGateway(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewGateway return a new instance.

func NewGatewayClass added in v0.20.0

func NewGatewayClass(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewGatewayClass return a new instance.

func NewHTTPRoute added in v0.20.0

func NewHTTPRoute(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewHTTPRoute return a new instance.

func NewHorizontalPodAutoscaler

func NewHorizontalPodAutoscaler(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewHorizontalPodAutoscaler returns a new instance.

func NewIngress added in v0.4.0

func NewIngress(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewIngress return a new instance.

func NewJob added in v0.20.0

func NewJob(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewJob return a new instance.

func NewNamespace

func NewNamespace(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewNamespace returns a new instance.

func NewNetworkPolicy added in v0.4.0

func NewNetworkPolicy(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewNetworkPolicy return a new instance.

func NewNode

func NewNode(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewNode return a new instance.

func NewPersistentVolume

func NewPersistentVolume(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewPersistentVolume return a new instance.

func NewPersistentVolumeClaim

func NewPersistentVolumeClaim(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewPersistentVolumeClaim returns a new instance.

func NewPod

func NewPod(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewPod return a new instance.

func NewPodDisruptionBudget added in v0.3.10

func NewPodDisruptionBudget(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewPodDisruptionBudget return a new PodDisruptionBudget scruber.

func NewReplicaSet added in v0.4.0

func NewReplicaSet(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewReplicaSet returns a new instance.

func NewRole added in v0.6.0

func NewRole(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewRole returns a new instance.

func NewRoleBinding added in v0.6.0

func NewRoleBinding(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewRoleBinding returns a new instance.

func NewSecret

func NewSecret(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewSecret return a new Secret scruber.

func NewService

func NewService(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewService return a new instance.

func NewServiceAccount

func NewServiceAccount(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewServiceAccount returns a new instance.

func NewStatefulSet

func NewStatefulSet(ctx context.Context, c *Cache, codes *issues.Codes) Linter

NewStatefulSet return a new StatefulSet scruber.

type LoaderFn added in v0.20.0

type LoaderFn func(context.Context, *db.Loader, types.GVR) error

LoaderFn represents a resource loader.

type Namespace

type Namespace struct {
	*issues.Collector
	*Cache
}

Namespace represents a Namespace scruber.

func (*Namespace) Lint added in v0.20.0

func (s *Namespace) Lint(ctx context.Context) error

Lint all available Namespaces.

func (*Namespace) Preloads added in v0.20.0

func (s *Namespace) Preloads() Preloads

type NetworkPolicy added in v0.4.0

type NetworkPolicy struct {
	*issues.Collector
	*Cache
}

NetworkPolicy represents a NetworkPolicy scruber.

func (*NetworkPolicy) Lint added in v0.20.0

func (s *NetworkPolicy) Lint(ctx context.Context) error

Lint all available NetworkPolicies.

func (*NetworkPolicy) Preloads added in v0.20.0

func (s *NetworkPolicy) Preloads() Preloads

type Node

type Node struct {
	*issues.Collector
	*Cache
}

Node represents a Node scruber.

func (*Node) Lint added in v0.20.0

func (s *Node) Lint(ctx context.Context) error

Lint all available Nodes.

func (*Node) Preloads added in v0.20.0

func (s *Node) Preloads() Preloads

type PersistentVolume

type PersistentVolume struct {
	*issues.Collector
	*Cache
}

PersistentVolume represents a PersistentVolume scruber.

func (*PersistentVolume) Lint added in v0.20.0

func (s *PersistentVolume) Lint(ctx context.Context) error

Lint all available PersistentVolumes.

func (*PersistentVolume) Preloads added in v0.20.0

func (s *PersistentVolume) Preloads() Preloads

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	*issues.Collector
	*Cache
}

PersistentVolumeClaim represents a PersistentVolumeClaim scruber.

func (*PersistentVolumeClaim) Lint added in v0.20.0

Lint all available PersistentVolumeClaims.

func (*PersistentVolumeClaim) Preloads added in v0.20.0

func (s *PersistentVolumeClaim) Preloads() Preloads

type Pod

type Pod struct {
	*issues.Collector
	*Cache
}

Pod represents a Pod scruber.

func (*Pod) Lint added in v0.20.0

func (s *Pod) Lint(ctx context.Context) error

Lint all available Pods.

func (*Pod) Preloads added in v0.20.0

func (s *Pod) Preloads() Preloads

type PodDisruptionBudget added in v0.3.10

type PodDisruptionBudget struct {
	*issues.Collector
	*Cache
}

PodDisruptionBudget represents a pdb scruber.

func (*PodDisruptionBudget) Lint added in v0.20.0

Lint all available PodDisruptionBudgets.

func (*PodDisruptionBudget) Preloads added in v0.20.0

func (s *PodDisruptionBudget) Preloads() Preloads

type Preloads added in v0.20.0

type Preloads map[internal.R]LoaderFn

func (Preloads) Merge added in v0.20.0

func (p Preloads) Merge(ll Preloads)

type ReplicaSet added in v0.4.0

type ReplicaSet struct {
	*issues.Collector
	*Cache
}

ReplicaSet represents a ReplicaSet scruber.

func (*ReplicaSet) Lint added in v0.20.0

func (s *ReplicaSet) Lint(ctx context.Context) error

Lint all available ReplicaSets.

func (*ReplicaSet) Preloads added in v0.20.0

func (s *ReplicaSet) Preloads() Preloads

type Role added in v0.6.0

type Role struct {
	*issues.Collector
	*Cache
}

Role represents a Role scruber.

func (*Role) Lint added in v0.20.0

func (s *Role) Lint(ctx context.Context) error

Lint all available Roles.

func (*Role) Preloads added in v0.20.0

func (s *Role) Preloads() Preloads

type RoleBinding added in v0.6.0

type RoleBinding struct {
	*issues.Collector
	*Cache
}

RoleBinding represents a RoleBinding scruber.

func (*RoleBinding) Lint added in v0.20.0

func (s *RoleBinding) Lint(ctx context.Context) error

Lint all available RoleBindings.

func (*RoleBinding) Preloads added in v0.20.0

func (s *RoleBinding) Preloads() Preloads

type ScrubFn added in v0.20.0

type ScrubFn func(context.Context, *Cache, *issues.Codes) Linter

ScrubFn represents a resource scruber.

type Scrubs added in v0.20.0

type Scrubs map[internal.R]ScrubFn

type Secret

type Secret struct {
	*issues.Collector
	*Cache
}

Secret represents a Secret scruber.

func (*Secret) Lint added in v0.20.0

func (s *Secret) Lint(ctx context.Context) error

Lint all available Secrets.

func (*Secret) Preloads added in v0.20.0

func (s *Secret) Preloads() Preloads

type Service

type Service struct {
	*issues.Collector
	*Cache
}

Service represents a Service scruber.

func (*Service) Lint added in v0.20.0

func (s *Service) Lint(ctx context.Context) error

Lint all available Services.

func (*Service) Preloads added in v0.20.0

func (s *Service) Preloads() Preloads

type ServiceAccount added in v0.4.0

type ServiceAccount struct {
	*issues.Collector
	*Cache
}

ServiceAccount represents a ServiceAccount scruber.

func (*ServiceAccount) Lint added in v0.20.0

func (s *ServiceAccount) Lint(ctx context.Context) error

Lint all available ServiceAccounts.

func (*ServiceAccount) Preloads added in v0.20.0

func (s *ServiceAccount) Preloads() Preloads

type StatefulSet

type StatefulSet struct {
	*issues.Collector
	*Cache
}

StatefulSet represents a StatefulSet scruber.

func (*StatefulSet) Lint added in v0.20.0

func (s *StatefulSet) Lint(ctx context.Context) error

Lint all available StatefulSets.

func (*StatefulSet) Preloads added in v0.20.0

func (s *StatefulSet) Preloads() Preloads

Jump to

Keyboard shortcuts

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