Documentation ¶
Index ¶
- Constants
- Variables
- func AsPerc(p string) string
- func AsStatus(err error) string
- func AsThousands(n int64) string
- func ExtractImages(spec *v1.PodSpec) []string
- func IntToStr(p int) string
- func Pad(s string, width int) string
- func PodStatus(pod *v1.Pod) string
- func PrintPerc(p int) string
- func ToAge(t metav1.Time) string
- func ToContainerPorts(pp []v1.ContainerPort) string
- func ToContainerState(s v1.ContainerState) string
- func ToPorts(pp []v1.ServicePort) string
- func Truncate(str string, width int) string
- func UrlFor(host, path, port, address string) string
- type Alias
- type AliasRes
- type Base
- type BenchCfg
- type BenchInfo
- type Benchmark
- type ClusterRole
- type ClusterRoleBinding
- type ConfigMap
- type Container
- type ContainerRes
- type ContainerWithMetrics
- type Context
- type ContextNamer
- type CronJob
- type CustomResourceDefinition
- type DaemonSet
- type DecoratorFunc
- type Deployment
- type Dir
- type DirRes
- type Endpoints
- type Event
- type FileRes
- type ForwardRes
- type Forwarder
- type Generic
- type HorizontalPodAutoscaler
- type ImageScan
- type ImageScanRes
- type Issue
- type Issues
- type Job
- type NamedContext
- type Namespace
- type NetworkPolicy
- type Node
- type NodeWithMetrics
- type Outcome
- type PersistentVolume
- type PersistentVolumeClaim
- type Pod
- type PodDisruptionBudget
- type PodWithMetrics
- type Policies
- type Policy
- type PolicyRes
- type PortForward
- type Rbac
- type Reference
- type ReferenceRes
- type ReplicaSet
- type Role
- type RoleBinding
- type RuleRes
- type Rules
- type ScreenDump
- type Secret
- type Section
- type Sections
- type Service
- type ServiceAccount
- type StatefulSet
- type StorageClass
- type Subject
- type SubjectRes
- type Subjects
- type Tally
- type Workload
- type WorkloadRes
Constants ¶
const ( PhaseTerminating = "Terminating" PhaseInitialized = "Initialized" PhaseRunning = "Running" PhaseNotReady = "NoReady" PhaseCompleted = "Completed" PhaseContainerCreating = "ContainerCreating" PhasePodInitializing = "PodInitializing" PhaseUnknown = "Unknown" PhaseCrashLoop = "CrashLoopBackOff" PhaseError = "Error" PhaseImagePullBackOff = "ImagePullBackOff" PhaseOOMKilled = "OOMKilled" PhasePending = "Pending" PhaseContainerStatusUnknown = "ContainerStatusUnknown" PhaseEvicted = "Evicted" )
const ( // Terminating represents a pod terminating status. Terminating = "Terminating" // Running represents a pod running status. Running = "Running" // Initialized represents a pod initialized status. Initialized = "Initialized" // Completed represents a pod completed status. Completed = "Completed" // ContainerCreating represents a pod container status. ContainerCreating = "ContainerCreating" // PodInitializing represents a pod initializing status. PodInitializing = "PodInitializing" // Pending represents a pod pending status. Pending = "Pending" // Blank represents no value. Blank = "" )
const ( // MissingValue indicates an unset value. MissingValue = "<none>" // NAValue indicates a value that does not pertain. NAValue = "n/a" // UnknownValue represents an unknown. UnknownValue = "<unknown>" // UnsetValue represent an unset value. UnsetValue = "" // ZeroValue represents a zero value. ZeroValue = "0" )
const (
CVEParseIdx = 5
)
const ( // NodeUnreachablePodReason is reason and message set on a pod when its state // cannot be confirmed as kubelet is unresponsive on the node it is (was) running. NodeUnreachablePodReason = "NodeLost" // k8s.io/kubernetes/pkg/util/node.NodeUnreachablePodReason )
const (
// NonResource represents a custom resource.
NonResource = "*"
)
Variables ¶
var AgeDecorator = func(a string) string {
return toAgeHuman(a)
}
AgeDecorator represents a timestamped as human column.
Functions ¶
func AsThousands ¶
AsThousands prints a number with thousand separator.
func ExtractImages ¶
ExtractImages returns a collection of container images. !!BOZO!! If this has any legs?? enable scans on other container types.
func ToContainerPorts ¶
func ToContainerPorts(pp []v1.ContainerPort) string
ToContainerPorts returns container ports as a string.
func ToContainerState ¶
func ToContainerState(s v1.ContainerState) string
ToContainerState returns container state as a string.
Types ¶
type AliasRes ¶
AliasRes represents an alias resource.
func (AliasRes) DeepCopyObject ¶
DeepCopyObject returns a container copy.
func (AliasRes) GetObjectKind ¶
func (AliasRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type Base ¶
type Base struct{}
func (Base) ColorerFunc ¶
func (Base) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type BenchInfo ¶
BenchInfo represents benchmark run info.
func (BenchInfo) DeepCopyObject ¶
DeepCopyObject returns a container copy.
func (BenchInfo) GetObjectKind ¶
func (BenchInfo) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type Benchmark ¶
type Benchmark struct {
Base
}
Benchmark renders a benchmarks to screen.
func (Benchmark) ColorerFunc ¶
func (b Benchmark) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type ClusterRole ¶
type ClusterRole struct {
Base
}
ClusterRole renders a K8s ClusterRole to screen.
type ClusterRoleBinding ¶
type ClusterRoleBinding struct {
Base
}
ClusterRoleBinding renders a K8s ClusterRoleBinding to screen.
type ConfigMap ¶
type ConfigMap struct {
Base
}
ConfigMap renders a K8s ConfigMap to screen.
type Container ¶
type Container struct {
Base
}
Container renders a K8s Container to screen.
func (Container) ColorerFunc ¶
func (c Container) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type ContainerRes ¶
type ContainerRes struct { Container *v1.Container Status *v1.ContainerStatus MX *mv1beta1.ContainerMetrics Idx string Age metav1.Time }
ContainerRes represents a container and its metrics.
func (ContainerRes) DeepCopyObject ¶
func (c ContainerRes) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (ContainerRes) GetObjectKind ¶
func (c ContainerRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type ContainerWithMetrics ¶
type ContainerWithMetrics interface { // Container returns the container Container() *v1.Container // ContainerStatus returns the current container status. ContainerStatus() *v1.ContainerStatus // Metrics returns the container metrics. Metrics() *mv1beta1.ContainerMetrics // Age returns the pod age. Age() metav1.Time // IsInit indicates a init container. IsInit() bool }
ContainerWithMetrics represents a container and it's metrics.
type Context ¶
type Context struct {
Base
}
Context renders a K8s ConfigMap to screen.
func (Context) ColorerFunc ¶
func (Context) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type ContextNamer ¶
ContextNamer represents a named context.
type CustomResourceDefinition ¶
type CustomResourceDefinition struct {
Base
}
CustomResourceDefinition renders a K8s CustomResourceDefinition to screen.
type DaemonSet ¶
type DaemonSet struct {
Base
}
DaemonSet renders a K8s DaemonSet to screen.
type Deployment ¶
type Deployment struct {
Base
}
Deployment renders a K8s Deployment to screen.
func (Deployment) ColorerFunc ¶
func (d Deployment) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type Dir ¶
type Dir struct{}
Dir renders a directory entry to screen.
func (Dir) ColorerFunc ¶
func (Dir) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type DirRes ¶
DirRes represents an alias resource.
func (DirRes) DeepCopyObject ¶
DeepCopyObject returns a container copy.
func (DirRes) GetObjectKind ¶
func (DirRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type Endpoints ¶
type Endpoints struct {
Base
}
Endpoints renders a K8s Endpoints to screen.
type Event ¶
type Event struct {
Generic
}
Event renders a K8s Event to screen.
func (*Event) ColorerFunc ¶
func (e *Event) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type FileRes ¶
FileRes represents a file resource.
func (FileRes) DeepCopyObject ¶
DeepCopyObject returns a container copy.
func (FileRes) GetObjectKind ¶
func (c FileRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type ForwardRes ¶
ForwardRes represents a benchmark resource.
func (ForwardRes) DeepCopyObject ¶
func (f ForwardRes) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (ForwardRes) GetObjectKind ¶
func (f ForwardRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type Forwarder ¶
type Forwarder interface { // ID returns the PF FQN. ID() string // Container returns a container name. Container() string // Port returns container exposed port. Port() string // Address returns the host address. Address() string // Active returns forwarder current state. Active() bool // Age returns forwarder age. Age() time.Time }
Forwarder represents a port forwarder.
type Generic ¶
type Generic struct { Base // contains filtered or unexported fields }
Generic renders a generic resource to screen.
func (*Generic) ColorerFunc ¶
func (*Generic) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type HorizontalPodAutoscaler ¶
type HorizontalPodAutoscaler struct {
Generic
}
HorizontalPodAutoscaler renders a K8s HorizontalPodAutoscaler to screen.
func (HorizontalPodAutoscaler) ColorerFunc ¶
func (hpa HorizontalPodAutoscaler) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type ImageScan ¶
type ImageScan struct {
Base
}
ImageScan renders scans report table.
func (ImageScan) ColorerFunc ¶
func (c ImageScan) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type ImageScanRes ¶
ImageScanRes represents a container and its metrics.
func (ImageScanRes) DeepCopyObject ¶
func (is ImageScanRes) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (ImageScanRes) GetObjectKind ¶
func (ImageScanRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type Issue ¶
type Issue struct { Group string `yaml:"group" json:"group"` GVR string `yaml:"gvr" json:"gvr"` Level config.Level `yaml:"level" json:"level"` Message string `yaml:"message" json:"message"` }
Issue represents a sanitization issue.
type NamedContext ¶
type NamedContext struct { Name string Context *api.Context Config ContextNamer }
NamedContext represents a named cluster context.
func NewNamedContext ¶
func NewNamedContext(c ContextNamer, n string, ctx *api.Context) *NamedContext
NewNamedContext returns a new named context.
func (*NamedContext) DeepCopyObject ¶
func (c *NamedContext) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (*NamedContext) GetObjectKind ¶
func (c *NamedContext) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
func (*NamedContext) IsCurrentContext ¶
func (c *NamedContext) IsCurrentContext(n string) bool
IsCurrentContext return the active context name.
type Namespace ¶
type Namespace struct {
Base
}
Namespace renders a K8s Namespace to screen.
func (Namespace) ColorerFunc ¶
func (n Namespace) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type NetworkPolicy ¶
type NetworkPolicy struct {
Base
}
NetworkPolicy renders a K8s NetworkPolicy to screen.
type NodeWithMetrics ¶
type NodeWithMetrics struct { Raw *unstructured.Unstructured MX *mv1beta1.NodeMetrics PodCount int }
NodeWithMetrics represents a node with its associated metrics.
func (*NodeWithMetrics) DeepCopyObject ¶
func (n *NodeWithMetrics) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (*NodeWithMetrics) GetObjectKind ¶
func (n *NodeWithMetrics) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type PersistentVolume ¶
type PersistentVolume struct {
Base
}
PersistentVolume renders a K8s PersistentVolume to screen.
func (PersistentVolume) ColorerFunc ¶
func (p PersistentVolume) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type PersistentVolumeClaim ¶
type PersistentVolumeClaim struct {
Base
}
PersistentVolumeClaim renders a K8s PersistentVolumeClaim to screen.
type Pod ¶
type Pod struct {
Base
}
Pod renders a K8s Pod to screen.
func (Pod) ColorerFunc ¶
func (p Pod) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type PodDisruptionBudget ¶
type PodDisruptionBudget struct {
Base
}
PodDisruptionBudget renders a K8s PodDisruptionBudget to screen.
type PodWithMetrics ¶
type PodWithMetrics struct { Raw *unstructured.Unstructured MX *mv1beta1.PodMetrics }
PodWithMetrics represents a pod and its metrics.
func (*PodWithMetrics) DeepCopyObject ¶
func (p *PodWithMetrics) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (*PodWithMetrics) GetObjectKind ¶
func (p *PodWithMetrics) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type Policy ¶
type Policy struct {
Base
}
Policy renders a rbac policy to screen.
func (Policy) ColorerFunc ¶
func (Policy) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type PolicyRes ¶
type PolicyRes struct {
Namespace, Binding string
Resource, Group string
ResourceName string
NonResourceURL string
Verbs []string
}
PolicyRes represents a rbac policy rule.
func NewPolicyRes ¶
NewPolicyRes returns a new policy.
func (PolicyRes) DeepCopyObject ¶
DeepCopyObject returns a container copy.
func (PolicyRes) GetObjectKind ¶
func (p PolicyRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type PortForward ¶
type PortForward struct {
Base
}
PortForward renders a portforwards to screen.
func (PortForward) ColorerFunc ¶
func (PortForward) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type Rbac ¶
type Rbac struct {
Base
}
Rbac renders a rbac to screen.
func (Rbac) ColorerFunc ¶
func (Rbac) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type Reference ¶
type Reference struct {
Base
}
Reference renders a reference to screen.
func (Reference) ColorerFunc ¶
func (Reference) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type ReferenceRes ¶
ReferenceRes represents a reference resource.
func (ReferenceRes) DeepCopyObject ¶
func (a ReferenceRes) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (ReferenceRes) GetObjectKind ¶
func (ReferenceRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type ReplicaSet ¶
type ReplicaSet struct {
Base
}
ReplicaSet renders a K8s ReplicaSet to screen.
func (ReplicaSet) ColorerFunc ¶
func (r ReplicaSet) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type RoleBinding ¶
type RoleBinding struct {
Base
}
RoleBinding renders a K8s RoleBinding to screen.
type RuleRes ¶
type RuleRes struct {
Resource, Group string
ResourceName string
NonResourceURL string
Verbs []string
}
RuleRes represents an rbac rule.
func NewRuleRes ¶
NewRuleRes returns a new rule.
func (RuleRes) DeepCopyObject ¶
DeepCopyObject returns a container copy.
func (RuleRes) GetObjectKind ¶
func (r RuleRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type ScreenDump ¶
type ScreenDump struct {
Base
}
ScreenDump renders a screendumps to screen.
func (ScreenDump) ColorerFunc ¶
func (ScreenDump) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type Section ¶
type Section struct { Title string `json:"sanitizer" yaml:"sanitizer"` GVR string `yaml:"gvr" json:"gvr"` Tally *Tally `json:"tally" yaml:"tally"` Outcome Outcome `json:"issues,omitempty" yaml:"issues,omitempty"` }
Section represents a sanitizer pass.
type ServiceAccount ¶
type ServiceAccount struct {
Base
}
ServiceAccount renders a K8s ServiceAccount to screen.
type StatefulSet ¶
type StatefulSet struct {
Base
}
StatefulSet renders a K8s StatefulSet to screen.
type StorageClass ¶
type StorageClass struct {
Base
}
StorageClass renders a K8s StorageClass to screen.
type Subject ¶
type Subject struct {
Base
}
Subject renders a rbac to screen.
func (Subject) ColorerFunc ¶
func (Subject) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type SubjectRes ¶
type SubjectRes struct {
Name, Kind, FirstLocation string
}
SubjectRes represents a subject rule.
func (SubjectRes) DeepCopyObject ¶
func (s SubjectRes) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (SubjectRes) GetObjectKind ¶
func (SubjectRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
type Subjects ¶
type Subjects []SubjectRes
Subjects represents a collection of RBAC policies.
func (Subjects) Upsert ¶
func (ss Subjects) Upsert(s SubjectRes) Subjects
Upsert adds a new subject.
type Workload ¶
type Workload struct {
Base
}
Workload renders a workload to screen.
func (Workload) ColorerFunc ¶
func (n Workload) ColorerFunc() model1.ColorerFunc
ColorerFunc colors a resource row.
type WorkloadRes ¶
func (*WorkloadRes) DeepCopyObject ¶
func (a *WorkloadRes) DeepCopyObject() runtime.Object
DeepCopyObject returns a container copy.
func (*WorkloadRes) GetObjectKind ¶
func (a *WorkloadRes) GetObjectKind() schema.ObjectKind
GetObjectKind returns a schema object.
Source Files ¶
- alias.go
- base.go
- benchmark.go
- cm.go
- container.go
- context.go
- cr.go
- crb.go
- crd.go
- cronjob.go
- dir.go
- dp.go
- ds.go
- ep.go
- ev.go
- generic.go
- helpers.go
- hpa.go
- img_scan.go
- job.go
- node.go
- np.go
- ns.go
- pdb.go
- pod.go
- policy.go
- popeye.go
- portforward.go
- pv.go
- pvc.go
- rbac.go
- reference.go
- ro.go
- rob.go
- rs.go
- sa.go
- sc.go
- screen_dump.go
- secret.go
- sts.go
- subject.go
- svc.go
- types.go
- workload.go