popeye: github.com/derailed/popeye/internal/sanitize Index | Files

package sanitize

import "github.com/derailed/popeye/internal/sanitize"

Index

Package Files

cluster.go cm.go container.go container_status.go dp.go ds.go helper.go hpa.go ing.go metrics.go node.go np.go ns.go pdb.go pod.go psp.go pv.go pvc.go rs.go sa.go secret.go sts.go svc.go

func ToPerc Uses

func ToPerc(v1, v2 int64) int64

ToPerc computes the percentage from one number over another.

type Cluster Uses

type Cluster struct {
    *issues.Collector
    ClusterLister
}

Cluster tracks cluster sanitization.

func NewCluster Uses

func NewCluster(co *issues.Collector, lister ClusterLister) *Cluster

NewCluster returns a new Cluster sanitizer.

func (*Cluster) Sanitize Uses

func (c *Cluster) Sanitize(ctx context.Context) error

Sanitize configmaps.

type ClusterLister Uses

type ClusterLister interface {
    ListVersion() (string, string)
}

ClusterLister list available Clusters on a cluster.

type ClusterMetricsLister Uses

type ClusterMetricsLister interface {
    ListClusterMetrics() v1.ResourceList
}

ClusterMetricsLister handles cluster metrics.

type ClusterRoleBindingLister Uses

type ClusterRoleBindingLister interface {
    ListClusterRoleBindings() map[string]*rbacv1.ClusterRoleBinding
}

ClusterRoleBindingLister list all available ClusterRoleBindings.

type Collector Uses

type Collector interface {
    Outcome() issues.Outcome
    AddSubCode(id issues.ID, p, s string, args ...interface{})
}

Collector collects sub issues.

type ConfigLister Uses

type ConfigLister interface {
    CPUResourceLimits() config.Allocations
    MEMResourceLimits() config.Allocations
}

ConfigLister tracks configuration parameters.

type ConfigMap Uses

type ConfigMap struct {
    *issues.Collector
    ConfigMapLister
}

ConfigMap tracks ConfigMap sanitization.

func NewConfigMap Uses

func NewConfigMap(c *issues.Collector, lister ConfigMapLister) *ConfigMap

NewConfigMap returns a new ConfigMap sanitizer.

func (*ConfigMap) Sanitize Uses

func (c *ConfigMap) Sanitize(context.Context) error

Sanitize a configmap.

type ConfigMapLister Uses

type ConfigMapLister interface {
    PodRefs
    ListConfigMaps() map[string]*v1.ConfigMap
}

ConfigMapLister list available ConfigMaps on a cluster.

type ConsumptionMetrics Uses

type ConsumptionMetrics struct {
    QOS                    v1.PodQOSClass
    CurrentCPU, CurrentMEM resource.Quantity
    RequestCPU, RequestMEM resource.Quantity
    LimitCPU, LimitMEM     resource.Quantity
    RequestedStorage       resource.Quantity
}

ConsumptionMetrics tracks managed pods resource utilization.

func (*ConsumptionMetrics) LimitCPURatio Uses

func (d *ConsumptionMetrics) LimitCPURatio() float64

LimitCPURatio returns current cpu usage over requested percentage.

func (*ConsumptionMetrics) LimitMEMRatio Uses

func (d *ConsumptionMetrics) LimitMEMRatio() float64

LimitMEMRatio returns current memory usage over requested percentage.

func (*ConsumptionMetrics) ReqAbsCPURatio Uses

func (d *ConsumptionMetrics) ReqAbsCPURatio() float64

ReqAbsCPURatio returns abasolute cpu ratio.

func (*ConsumptionMetrics) ReqAbsMEMRatio Uses

func (d *ConsumptionMetrics) ReqAbsMEMRatio() float64

ReqAbsMEMRatio returns absolute mem ratio.

func (*ConsumptionMetrics) ReqCPURatio Uses

func (d *ConsumptionMetrics) ReqCPURatio() float64

ReqCPURatio returns current cpu usage over requested percentage.

func (*ConsumptionMetrics) ReqMEMRatio Uses

func (d *ConsumptionMetrics) ReqMEMRatio() float64

ReqMEMRatio returns current memory usage over requested percentage.

type Container Uses

type Container struct {
    LimitCollector
    // contains filtered or unexported fields
}

Container represents a Container linter.

func NewContainer Uses

func NewContainer(fqn string, c LimitCollector) *Container

NewContainer returns a new container linter.

type DaemonLister Uses

type DaemonLister interface {
    ListDaemonSets() map[string]*appsv1.DaemonSet
}

DaemonLister list DaemonSets.

type DaemonSet Uses

type DaemonSet struct {
    *issues.Collector
    DaemonSetLister
}

DaemonSet tracks DaemonSet sanitization.

func NewDaemonSet Uses

func NewDaemonSet(co *issues.Collector, lister DaemonSetLister) *DaemonSet

NewDaemonSet returns a new DaemonSet sanitizer.

func (*DaemonSet) Sanitize Uses

func (d *DaemonSet) Sanitize(ctx context.Context) error

Sanitize configmaps.

type DaemonSetLister Uses

type DaemonSetLister interface {
    PodLimiter
    PodsMetricsLister
    PodSelectorLister
    ConfigLister
    DaemonLister
}

DaemonSetLister list available DaemonSets on a cluster.

type DeployLister Uses

type DeployLister interface {
    ListDeployments() map[string]*appsv1.Deployment
}

DeployLister list deployments.

type Deployment Uses

type Deployment struct {
    *issues.Collector
    DeploymentLister
}

Deployment tracks Deployment sanitization.

func NewDeployment Uses

func NewDeployment(co *issues.Collector, lister DeploymentLister) *Deployment

NewDeployment returns a new Deployment sanitizer.

func (*Deployment) Sanitize Uses

func (d *Deployment) Sanitize(ctx context.Context) error

Sanitize configmaps.

type DeploymentLister Uses

type DeploymentLister interface {
    PodLimiter
    PodsMetricsLister
    PodSelectorLister
    ConfigLister
    DeployLister
}

DeploymentLister list available Deployments on a cluster.

type EndPointLister Uses

type EndPointLister interface {
    GetEndpoints(string) *v1.Endpoints
}

EndPointLister find all service endpoints.

type HorizontalPodAutoscaler Uses

type HorizontalPodAutoscaler struct {
    *issues.Collector
    HpaLister
}

HorizontalPodAutoscaler represents a HorizontalPodAutoscaler linter.

func NewHorizontalPodAutoscaler Uses

func NewHorizontalPodAutoscaler(co *issues.Collector, lister HpaLister) *HorizontalPodAutoscaler

NewHorizontalPodAutoscaler returns a new ServiceAccount linter.

func (*HorizontalPodAutoscaler) Sanitize Uses

func (h *HorizontalPodAutoscaler) Sanitize(ctx context.Context) error

Sanitize an horizontalpodautoscaler.

type HpaLister Uses

type HpaLister interface {
    DeployLister
    StatefulSetLister
    ClusterMetricsLister
    NodeMetricsLister
    ListHorizontalPodAutoscalers() map[string]*autoscalingv1.HorizontalPodAutoscaler
}

HpaLister list available hpas on a cluster.

type IngLister Uses

type IngLister interface {
    ListIngresses() map[string]*nv1beta1.Ingress
}

IngLister list deployments.

type Ingress Uses

type Ingress struct {
    *issues.Collector
    IngressLister
}

Ingress tracks Ingress sanitization.

func NewIngress Uses

func NewIngress(co *issues.Collector, lister IngressLister) *Ingress

NewIngress returns a new Ingress sanitizer.

func (*Ingress) Sanitize Uses

func (d *Ingress) Sanitize(ctx context.Context) error

Sanitize configmaps.

type IngressLister Uses

type IngressLister interface {
    IngLister
}

IngressLister list available Ingresss on a cluster.

type IngressRefs Uses

type IngressRefs interface {
    IngressRefs(cache.ObjReferences)
}

IngressRefs tracks Ingress object references.

type LimitCollector Uses

type LimitCollector interface {
    Collector
    PodLimiter
}

LimitCollector represents a collector with resource limits.

type Namespace Uses

type Namespace struct {
    *issues.Collector
    NamespaceLister
}

Namespace represents a Namespace sanitizer.

func NewNamespace Uses

func NewNamespace(co *issues.Collector, lister NamespaceLister) *Namespace

NewNamespace returns a new namespace linter.

func (*Namespace) Sanitize Uses

func (n *Namespace) Sanitize(ctx context.Context) error

Sanitize a namespace

type NamespaceLister Uses

type NamespaceLister interface {
    NamespaceRefs
    ListNamespaces() map[string]*v1.Namespace
}

NamespaceLister lists all namespaces.

type NamespaceRefs Uses

type NamespaceRefs interface {
    ReferencedNamespaces(map[string]struct{})
}

NamespaceRefs tracks namespace references in the cluster.

type NamespaceSelectorLister Uses

type NamespaceSelectorLister interface {
    ListNamespacesBySelector(sel *metav1.LabelSelector) map[string]*v1.Namespace
}

NamespaceSelectorLister list a collection of namespaces matching a selector.

type NetworkPolicy Uses

type NetworkPolicy struct {
    *issues.Collector
    NetworkPolicyLister
}

NetworkPolicy tracks NetworkPolicy sanitization.

func NewNetworkPolicy Uses

func NewNetworkPolicy(co *issues.Collector, lister NetworkPolicyLister) *NetworkPolicy

NewNetworkPolicy returns a new NetworkPolicy sanitizer.

func (*NetworkPolicy) Sanitize Uses

func (n *NetworkPolicy) Sanitize(ctx context.Context) error

Sanitize configmaps.

type NetworkPolicyLister Uses

type NetworkPolicyLister interface {
    PodSelectorLister
    NamespaceSelectorLister
    ListNetworkPolicies() map[string]*nv1.NetworkPolicy
}

NetworkPolicyLister list available NetworkPolicys on a cluster.

type Node Uses

type Node struct {
    *issues.Collector
    NodeLister
}

Node represents a Node linter.

func NewNode Uses

func NewNode(co *issues.Collector, lister NodeLister) *Node

NewNode returns a new Node linter.

func (*Node) Sanitize Uses

func (n *Node) Sanitize(ctx context.Context) error

Sanitize a Node.

type NodeLimiter Uses

type NodeLimiter interface {
    NodeCPULimit() float64
    NodeMEMLimit() float64
}

NodeLimiter tracks metrics limit range.

type NodeLister Uses

type NodeLister interface {
    NodeMetricsLister
    PodLister
    NodeLimiter
    ListNodes() map[string]*v1.Node
}

NodeLister lists available nodes.

type NodeMetricsLister Uses

type NodeMetricsLister interface {
    ListNodesMetrics() map[string]*mv1beta1.NodeMetrics
}

NodeMetricsLister handle

type PdbLister Uses

type PdbLister interface {
    ListPodDisruptionBudgets() map[string]*pv1beta1.PodDisruptionBudget
    ForLabels(labels map[string]string) *pv1beta1.PodDisruptionBudget
}

PdbLister list pdb matching a given selector

type PersistentVolume Uses

type PersistentVolume struct {
    *issues.Collector
    PersistentVolumeLister
}

PersistentVolume represents a PersistentVolume sanitizer.

func NewPersistentVolume Uses

func NewPersistentVolume(co *issues.Collector, lister PersistentVolumeLister) *PersistentVolume

NewPersistentVolume returns a new PersistentVolume sanitizer.

func (*PersistentVolume) Sanitize Uses

func (p *PersistentVolume) Sanitize(ctx context.Context) error

Sanitize a PersistentVolume.

type PersistentVolumeClaim Uses

type PersistentVolumeClaim struct {
    *issues.Collector
    PersistentVolumeClaimLister
}

PersistentVolumeClaim represents a PersistentVolumeClaim sanitizer.

func NewPersistentVolumeClaim Uses

func NewPersistentVolumeClaim(co *issues.Collector, lister PersistentVolumeClaimLister) *PersistentVolumeClaim

NewPersistentVolumeClaim returns a new PersistentVolumeClaim sanitizer.

func (*PersistentVolumeClaim) Sanitize Uses

func (p *PersistentVolumeClaim) Sanitize(ctx context.Context) error

Sanitize a PersistentVolumeClaim.

type PersistentVolumeClaimLister Uses

type PersistentVolumeClaimLister interface {
    ListPersistentVolumeClaims() map[string]*v1.PersistentVolumeClaim
    PodLister
}

PersistentVolumeClaimLister list available PersistentVolumeClaim on a cluster.

type PersistentVolumeLister Uses

type PersistentVolumeLister interface {
    ListPersistentVolumes() map[string]*v1.PersistentVolume
}

PersistentVolumeLister list available PersistentVolume on a cluster.

type Pod Uses

type Pod struct {
    *issues.Collector
    PodMXLister
}

Pod represents a Pod linter.

func NewPod Uses

func NewPod(co *issues.Collector, lister PodMXLister) *Pod

NewPod returns a new pod linter.

func (*Pod) Sanitize Uses

func (p *Pod) Sanitize(ctx context.Context) error

Sanitize a Pod.

type PodDisruptionBudget Uses

type PodDisruptionBudget struct {
    *issues.Collector
    PodDisruptionBudgetLister
}

PodDisruptionBudget tracks PodDisruptionBudget sanitization.

func NewPodDisruptionBudget Uses

func NewPodDisruptionBudget(c *issues.Collector, lister PodDisruptionBudgetLister) *PodDisruptionBudget

NewPodDisruptionBudget returns a new PodDisruptionBudget sanitizer.

func (*PodDisruptionBudget) Sanitize Uses

func (c *PodDisruptionBudget) Sanitize(context.Context) error

Sanitize a configmap.

type PodDisruptionBudgetLister Uses

type PodDisruptionBudgetLister interface {
    PodLister
    ListPodDisruptionBudgets() map[string]*pv1beta1.PodDisruptionBudget
}

PodDisruptionBudgetLister list available PodDisruptionBudgets on a cluster.

type PodGetter Uses

type PodGetter interface {
    GetPod(map[string]string) *v1.Pod
}

PodGetter find a single pod matching service selector.

type PodLimiter Uses

type PodLimiter interface {
    PodCPULimit() float64
    PodMEMLimit() float64
    RestartsLimit() int
}

PodLimiter tracks metrics limit range.

type PodLister Uses

type PodLister interface {
    ListPods() map[string]*v1.Pod
    GetPod(sel map[string]string) *v1.Pod
}

PodLister lists available pods.

type PodMXLister Uses

type PodMXLister interface {
    PodLimiter
    PodMetricsLister
    PodLister
    PdbLister
}

PodMXLister list available pods.

type PodMetric Uses

type PodMetric interface {
    CurrentCPU() int64
    CurrentMEM() int64
    Empty() bool
}

PodMetric tracks node metrics available and current range.

type PodMetricsLister Uses

type PodMetricsLister interface {
    ListPodsMetrics() map[string]*mv1beta1.PodMetrics
}

PodMetricsLister handles pods metrics.

type PodRefs Uses

type PodRefs interface {
    PodRefs(cache.ObjReferences)
}

PodRefs tracks pods object references.

type PodSecurityPolicy Uses

type PodSecurityPolicy struct {
    *issues.Collector
    PodSecurityPolicyLister
}

PodSecurityPolicy tracks PodSecurityPolicy sanitization.

func NewPodSecurityPolicy Uses

func NewPodSecurityPolicy(co *issues.Collector, lister PodSecurityPolicyLister) *PodSecurityPolicy

NewPodSecurityPolicy returns a new PodSecurityPolicy sanitizer.

func (*PodSecurityPolicy) Sanitize Uses

func (p *PodSecurityPolicy) Sanitize(ctx context.Context) error

Sanitize configmaps.

type PodSecurityPolicyLister Uses

type PodSecurityPolicyLister interface {
    ListPodSecurityPolicies() map[string]*pv1beta1.PodSecurityPolicy
}

PodSecurityPolicyLister list available PodSecurityPolicys on a cluster.

type PodSelectorLister Uses

type PodSelectorLister interface {
    ListPodsBySelector(sel *metav1.LabelSelector) map[string]*v1.Pod
}

PodSelectorLister list a collection of pod matching a selector.

type PodsMetricsLister Uses

type PodsMetricsLister interface {
    ListPodsMetrics() map[string]*mv1beta1.PodMetrics
}

PodsMetricsLister handles pods metrics.

type PopeyeKey Uses

type PopeyeKey string

PopeyeKey tracks context keys.

type ReplicaLister Uses

type ReplicaLister interface {
    ListReplicaSets() map[string]*appsv1.ReplicaSet
}

ReplicaLister list replicaset.

type ReplicaSet Uses

type ReplicaSet struct {
    *issues.Collector
    ReplicaSetLister
}

ReplicaSet tracks ReplicaSet sanitization.

func NewReplicaSet Uses

func NewReplicaSet(co *issues.Collector, lister ReplicaSetLister) *ReplicaSet

NewReplicaSet returns a new ReplicaSet sanitizer.

func (*ReplicaSet) Sanitize Uses

func (d *ReplicaSet) Sanitize(ctx context.Context) error

Sanitize configmaps.

type ReplicaSetLister Uses

type ReplicaSetLister interface {
    ReplicaLister
}

ReplicaSetLister list available ReplicaSets on a cluster.

type RoleBindingLister Uses

type RoleBindingLister interface {
    ListRoleBindings() map[string]*rbacv1.RoleBinding
}

RoleBindingLister list all available ClusterRoleBindings.

type SARefs Uses

type SARefs interface {
    ServiceAccountRefs(cache.ObjReferences)
}

SARefs tracks ServiceAccount object references.

type Secret Uses

type Secret struct {
    *issues.Collector
    SecretLister
}

Secret tracks Secret sanitization.

func NewSecret Uses

func NewSecret(co *issues.Collector, lister SecretLister) *Secret

NewSecret returns a new Secret sanitizer.

func (*Secret) Sanitize Uses

func (s *Secret) Sanitize(context.Context) error

Sanitize a secret.

type SecretLister Uses

type SecretLister interface {
    PodRefs
    SARefs
    IngressRefs
    ListSecrets() map[string]*v1.Secret
}

SecretLister list available Secrets on a cluster.

type Service Uses

type Service struct {
    *issues.Collector
    ServiceLister
}

Service represents a service linter.

func NewService Uses

func NewService(co *issues.Collector, lister ServiceLister) *Service

NewService returns a new service linter.

func (*Service) Sanitize Uses

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

Sanitize services.

type ServiceAccount Uses

type ServiceAccount struct {
    *issues.Collector

    ServiceAccountLister
}

ServiceAccount tracks ServiceAccount sanitizer.

func NewServiceAccount Uses

func NewServiceAccount(co *issues.Collector, lister ServiceAccountLister) *ServiceAccount

NewServiceAccount returns a new ServiceAccount linter.

func (*ServiceAccount) Sanitize Uses

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

Sanitize a serviceaccount.

type ServiceAccountLister Uses

type ServiceAccountLister interface {
    PodLister
    ClusterRoleBindingLister
    RoleBindingLister
    SecretLister

    ListServiceAccounts() map[string]*v1.ServiceAccount
}

ServiceAccountLister list available ServiceAccounts on a cluster.

type ServiceLister Uses

type ServiceLister interface {
    PodGetter
    EndPointLister
    ListServices() map[string]*v1.Service
}

ServiceLister list available Services on a cluster.

type StatefulSet Uses

type StatefulSet struct {
    *issues.Collector
    StatefulSetLister
}

StatefulSet represents a StatefulSet sanitizer.

func NewStatefulSet Uses

func NewStatefulSet(co *issues.Collector, lister StatefulSetLister) *StatefulSet

NewStatefulSet returns a new StatefulSet linter.

func (*StatefulSet) Sanitize Uses

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

Sanitize a StatefulSet.

type StatefulSetLister Uses

type StatefulSetLister interface {
    PodLimiter
    ConfigLister
    PodSelectorLister
    PodsMetricsLister

    ListStatefulSets() map[string]*appsv1.StatefulSet
}

StatefulSetLister handles statefulsets.

Package sanitize imports 22 packages (graph) and is imported by 3 packages. Updated 2019-11-13. Refresh now. Tools for package owners.