render

package
v0.32.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
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"
)
View Source
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 = ""
)
View Source
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"
)
View Source
const (
	CVEParseIdx = 5
)
View Source
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

)
View Source
const (
	// NonResource represents a custom resource.
	NonResource = "*"
)

Variables

View Source
var AgeDecorator = func(a string) string {
	return toAgeHuman(a)
}

AgeDecorator represents a timestamped as human column.

Functions

func AsPerc

func AsPerc(p string) string

AsPerc prints a number as percentage with parens.

func AsStatus added in v0.29.0

func AsStatus(err error) string

AsStatus returns error as string.

func AsThousands added in v0.17.4

func AsThousands(n int64) string

AsThousands prints a number with thousand separator.

func ExtractImages added in v0.29.0

func ExtractImages(spec *v1.PodSpec) []string

ExtractImages returns a collection of container images. !!BOZO!! If this has any legs?? enable scans on other container types.

func IntToStr added in v0.17.4

func IntToStr(p int) string

IntToStr converts an int to a string.

func Pad

func Pad(s string, width int) string

Pad a string up to the given length or truncates if greater than length.

func PodStatus added in v0.28.1

func PodStatus(pod *v1.Pod) string

PosStatus computes pod status.

func PrintPerc added in v0.17.4

func PrintPerc(p int) string

PrintPerc prints a number as percentage.

func ToAge added in v0.29.0

func ToAge(t metav1.Time) string

ToAge converts time to human duration.

func ToContainerPorts added in v0.17.0

func ToContainerPorts(pp []v1.ContainerPort) string

ToContainerPorts returns container ports as a string.

func ToContainerState added in v0.17.0

func ToContainerState(s v1.ContainerState) string

ToContainerState returns container state as a string.

func ToPorts added in v0.17.0

func ToPorts(pp []v1.ServicePort) string

ToPorts returns service ports as a string.

func Truncate

func Truncate(str string, width int) string

Truncate a string to the given l and suffix ellipsis if needed.

func UrlFor

func UrlFor(host, path, port string) string

UrlFor computes fq url for a given benchmark configuration.

Types

type Alias

type Alias struct {
	Base
}

Alias renders a aliases to screen.

func (Alias) Header

func (Alias) Header(ns string) model1.Header

Header returns a header row.

func (Alias) Render

func (Alias) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen. BOZO!! Pass in a row with pre-alloc fields??

type AliasRes

type AliasRes struct {
	GVR     string
	Aliases []string
}

AliasRes represents an alias resource.

func (AliasRes) DeepCopyObject

func (a AliasRes) DeepCopyObject() runtime.Object

DeepCopyObject returns a container copy.

func (AliasRes) GetObjectKind

func (AliasRes) GetObjectKind() schema.ObjectKind

GetObjectKind returns a schema object.

type Base added in v0.25.12

type Base struct{}

func (Base) ColorerFunc added in v0.25.12

func (Base) ColorerFunc() model1.ColorerFunc

ColorerFunc colors a resource row.

func (Base) Happy added in v0.25.12

func (Base) Happy(string, *model1.Row) bool

Happy returns true if resource is happy, false otherwise.

func (Base) IsGeneric added in v0.25.12

func (Base) IsGeneric() bool

IsGeneric identifies a generic handler.

type BenchCfg

type BenchCfg struct {
	C, N       int
	Host, Path string
}

BenchCfg represents a benchmark configuration.

type BenchInfo

type BenchInfo struct {
	File os.FileInfo
	Path string
}

BenchInfo represents benchmark run info.

func (BenchInfo) DeepCopyObject

func (b BenchInfo) DeepCopyObject() runtime.Object

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.

func (Benchmark) Header

func (Benchmark) Header(ns string) model1.Header

Header returns a header row.

func (Benchmark) Render

func (b Benchmark) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type ClusterRole

type ClusterRole struct {
	Base
}

ClusterRole renders a K8s ClusterRole to screen.

func (ClusterRole) Header

func (ClusterRole) Header(string) model1.Header

Header returns a header rbw.

func (ClusterRole) Render

func (ClusterRole) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type ClusterRoleBinding

type ClusterRoleBinding struct {
	Base
}

ClusterRoleBinding renders a K8s ClusterRoleBinding to screen.

func (ClusterRoleBinding) Header

Header returns a header rbw.

func (ClusterRoleBinding) Render

func (ClusterRoleBinding) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type ConfigMap added in v0.32.0

type ConfigMap struct {
	Base
}

ConfigMap renders a K8s ConfigMap to screen.

func (ConfigMap) Header added in v0.32.0

func (ConfigMap) Header(string) model1.Header

Header returns a header rbw.

func (ConfigMap) Render added in v0.32.0

func (n ConfigMap) Render(o interface{}, _ string, r *model1.Row) error

Render renders a K8s resource 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.

func (Container) Header

func (Container) Header(ns string) model1.Header

Header returns a header row.

func (Container) Render

func (c Container) Render(o interface{}, name string, r *model1.Row) error

Render renders a K8s resource to screen.

type ContainerRes

type ContainerRes struct {
	Container *v1.Container
	Status    *v1.ContainerStatus
	MX        *mv1beta1.ContainerMetrics
	IsInit    bool
	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.

func (Context) Header

func (Context) Header(ns string) model1.Header

Header returns a header row.

func (Context) Render

func (c Context) Render(o interface{}, _ string, r *model1.Row) error

Render renders a K8s resource to screen.

type ContextNamer

type ContextNamer interface {
	CurrentContextName() (string, error)
}

ContextNamer represents a named context.

type CronJob

type CronJob struct {
	Base
}

CronJob renders a K8s CronJob to screen.

func (CronJob) Header

func (CronJob) Header(ns string) model1.Header

Header returns a header row.

func (CronJob) Render

func (c CronJob) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type CustomResourceDefinition

type CustomResourceDefinition struct {
	Base
}

CustomResourceDefinition renders a K8s CustomResourceDefinition to screen.

func (CustomResourceDefinition) Header

Header returns a header rbw.

func (CustomResourceDefinition) Render

func (c CustomResourceDefinition) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type DaemonSet

type DaemonSet struct {
	Base
}

DaemonSet renders a K8s DaemonSet to screen.

func (DaemonSet) Header

func (DaemonSet) Header(ns string) model1.Header

Header returns a header row.

func (DaemonSet) Render

func (d DaemonSet) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type DecoratorFunc

type DecoratorFunc func(string) string

DecoratorFunc decorates a string.

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.

func (Deployment) Header

func (Deployment) Header(ns string) model1.Header

Header returns a header row.

func (Deployment) Render

func (d Deployment) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type Dir added in v0.21.0

type Dir struct{}

Dir renders a directory entry to screen.

func (Dir) ColorerFunc added in v0.21.0

func (Dir) ColorerFunc() model1.ColorerFunc

ColorerFunc colors a resource row.

func (Dir) Header added in v0.21.0

func (Dir) Header(ns string) model1.Header

Header returns a header row.

func (Dir) IsGeneric added in v0.25.12

func (Dir) IsGeneric() bool

IsGeneric identifies a generic handler.

func (Dir) Render added in v0.21.0

func (Dir) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen. BOZO!! Pass in a row with pre-alloc fields??

type DirRes added in v0.21.0

type DirRes struct {
	Entry os.DirEntry
	Path  string
}

DirRes represents an alias resource.

func (DirRes) DeepCopyObject added in v0.21.0

func (d DirRes) DeepCopyObject() runtime.Object

DeepCopyObject returns a container copy.

func (DirRes) GetObjectKind added in v0.21.0

func (DirRes) GetObjectKind() schema.ObjectKind

GetObjectKind returns a schema object.

type Endpoints

type Endpoints struct {
	Base
}

Endpoints renders a K8s Endpoints to screen.

func (Endpoints) Header

func (Endpoints) Header(ns string) model1.Header

Header returns a header row.

func (Endpoints) Render

func (e Endpoints) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource 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.

func (*Event) Header

func (e *Event) Header(ns string) model1.Header

func (*Event) IsGeneric added in v0.25.12

func (*Event) IsGeneric() bool

func (*Event) Render

func (e *Event) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type FileRes

type FileRes struct {
	File os.FileInfo
	Dir  string
}

FileRes represents a file resource.

func (FileRes) DeepCopyObject

func (c FileRes) DeepCopyObject() runtime.Object

DeepCopyObject returns a container copy.

func (FileRes) GetObjectKind

func (c FileRes) GetObjectKind() schema.ObjectKind

GetObjectKind returns a schema object.

type ForwardRes

type ForwardRes struct {
	Forwarder
	Config BenchCfg
}

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

	// Ports returns container exposed ports.
	Port() 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.

func (*Generic) Header

func (g *Generic) Header(ns string) model1.Header

Header returns a header row.

func (*Generic) IsGeneric added in v0.25.12

func (*Generic) IsGeneric() bool

func (*Generic) Render

func (g *Generic) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

func (*Generic) SetTable

func (g *Generic) SetTable(ns string, t *metav1.Table)

SetTable sets the tabular resource.

type ImageScan added in v0.29.0

type ImageScan struct {
	Base
}

ImageScan renders scans report table.

func (ImageScan) ColorerFunc added in v0.29.0

func (c ImageScan) ColorerFunc() model1.ColorerFunc

ColorerFunc colors a resource row.

func (ImageScan) Header added in v0.29.0

func (ImageScan) Header(ns string) model1.Header

Header returns a header row.

func (ImageScan) Render added in v0.29.0

func (is ImageScan) Render(o interface{}, name string, r *model1.Row) error

Render renders a K8s resource to screen.

type ImageScanRes added in v0.29.0

type ImageScanRes struct {
	Image string
	Row   vul.Row
}

ImageScanRes represents a container and its metrics.

func (ImageScanRes) DeepCopyObject added in v0.29.0

func (is ImageScanRes) DeepCopyObject() runtime.Object

DeepCopyObject returns a container copy.

func (ImageScanRes) GetObjectKind added in v0.29.0

func (ImageScanRes) GetObjectKind() schema.ObjectKind

GetObjectKind returns a schema object.

type Issue added in v0.19.0

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 Issues added in v0.19.0

type Issues []Issue

Issues represents a collection of issues.

type Job

type Job struct {
	Base
}

Job renders a K8s Job to screen.

func (Job) Header

func (Job) Header(ns string) model1.Header

Header returns a header row.

func (Job) Render

func (j Job) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

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.

func (Namespace) Header

func (Namespace) Header(string) model1.Header

Header returns a header rbw.

func (Namespace) Render

func (n Namespace) Render(o interface{}, _ string, r *model1.Row) error

Render renders a K8s resource to screen.

type NetworkPolicy

type NetworkPolicy struct {
	Base
}

NetworkPolicy renders a K8s NetworkPolicy to screen.

func (NetworkPolicy) Header

func (NetworkPolicy) Header(ns string) model1.Header

Header returns a header row.

func (NetworkPolicy) Render

func (n NetworkPolicy) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type Node

type Node struct {
	Base
}

Node renders a K8s Node to screen.

func (Node) Header

func (Node) Header(string) model1.Header

Header returns a header row.

func (Node) Render

func (n Node) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource 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 Outcome added in v0.19.0

type Outcome map[string]Issues

Outcome represents a classification of reports outcome.

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.

func (PersistentVolume) Header

Header returns a header rbw.

func (PersistentVolume) Render

func (p PersistentVolume) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type PersistentVolumeClaim

type PersistentVolumeClaim struct {
	Base
}

PersistentVolumeClaim renders a K8s PersistentVolumeClaim to screen.

func (PersistentVolumeClaim) Header

Header returns a header rbw.

func (PersistentVolumeClaim) Render

func (p PersistentVolumeClaim) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource 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.

func (Pod) Header

func (p Pod) Header(ns string) model1.Header

Header returns a header row.

func (*Pod) Phase added in v0.13.3

func (p *Pod) Phase(po *v1.Pod) string

Phase reports the given pod phase.

func (Pod) Render

func (p Pod) Render(o interface{}, ns string, row *model1.Row) error

Render renders a K8s resource to screen.

func (*Pod) Statuses added in v0.13.3

func (*Pod) Statuses(ss []v1.ContainerStatus) (cr, ct, rc int)

Statuses reports current pod container statuses.

type PodDisruptionBudget

type PodDisruptionBudget struct {
	Base
}

PodDisruptionBudget renders a K8s PodDisruptionBudget to screen.

func (PodDisruptionBudget) Header

Header returns a header row.

func (PodDisruptionBudget) Render

func (p PodDisruptionBudget) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource 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 Policies

type Policies []PolicyRes

Policies represents a collection of RBAC policies.

func (Policies) Upsert

func (pp Policies) Upsert(p PolicyRes) Policies

Upsert adds a new policy.

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.

func (Policy) Header

func (Policy) Header(ns string) model1.Header

Header returns a header row.

func (Policy) Render

func (Policy) Render(o interface{}, gvr string, r *model1.Row) error

Render renders a K8s resource to screen.

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

func NewPolicyRes(ns, binding, res, grp string, vv []string) PolicyRes

NewPolicyRes returns a new policy.

func (PolicyRes) DeepCopyObject

func (p PolicyRes) DeepCopyObject() runtime.Object

DeepCopyObject returns a container copy.

func (PolicyRes) GR added in v0.26.1

func (p PolicyRes) GR() string

GR returns the group/resource path.

func (PolicyRes) GetObjectKind

func (p PolicyRes) GetObjectKind() schema.ObjectKind

GetObjectKind returns a schema object.

func (PolicyRes) Merge added in v0.26.1

func (p PolicyRes) Merge(p1 PolicyRes) (PolicyRes, error)

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.

func (PortForward) Header

func (PortForward) Header(ns string) model1.Header

Header returns a header row.

func (PortForward) Render

func (f PortForward) Render(o interface{}, gvr string, r *model1.Row) error

Render renders a K8s resource to screen.

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.

func (Rbac) Header

func (Rbac) Header(ns string) model1.Header

Header returns a header row.

func (Rbac) Render

func (r Rbac) Render(o interface{}, ns string, ro *model1.Row) error

Render renders a K8s resource to screen.

type Reference added in v0.20.0

type Reference struct {
	Base
}

Reference renders a reference to screen.

func (Reference) ColorerFunc added in v0.20.0

func (Reference) ColorerFunc() model1.ColorerFunc

ColorerFunc colors a resource row.

func (Reference) Header added in v0.20.0

func (Reference) Header(ns string) model1.Header

Header returns a header row.

func (Reference) Render added in v0.20.0

func (Reference) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen. BOZO!! Pass in a row with pre-alloc fields??

type ReferenceRes added in v0.20.0

type ReferenceRes struct {
	Namespace string
	Name      string
	GVR       string
}

ReferenceRes represents a reference resource.

func (ReferenceRes) DeepCopyObject added in v0.20.0

func (a ReferenceRes) DeepCopyObject() runtime.Object

DeepCopyObject returns a container copy.

func (ReferenceRes) GetObjectKind added in v0.20.0

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.

func (ReplicaSet) Header

func (ReplicaSet) Header(ns string) model1.Header

Header returns a header row.

func (ReplicaSet) Render

func (r ReplicaSet) Render(o interface{}, ns string, row *model1.Row) error

Render renders a K8s resource to screen.

type Role

type Role struct {
	Base
}

Role renders a K8s Role to screen.

func (Role) Header

func (Role) Header(ns string) model1.Header

Header returns a header row.

func (Role) Render

func (r Role) Render(o interface{}, ns string, row *model1.Row) error

Render renders a K8s resource to screen.

type RoleBinding

type RoleBinding struct {
	Base
}

RoleBinding renders a K8s RoleBinding to screen.

func (RoleBinding) Header

func (RoleBinding) Header(ns string) model1.Header

Header returns a header rbw.

func (RoleBinding) Render

func (r RoleBinding) Render(o interface{}, ns string, row *model1.Row) error

Render renders a K8s resource to screen.

type RuleRes

type RuleRes struct {
	Resource, Group string
	ResourceName    string
	NonResourceURL  string
	Verbs           []string
}

RuleRes represents an rbac rule.

func NewRuleRes

func NewRuleRes(res, grp string, vv []string) RuleRes

NewRuleRes returns a new rule.

func (RuleRes) DeepCopyObject

func (r RuleRes) DeepCopyObject() runtime.Object

DeepCopyObject returns a container copy.

func (RuleRes) GetObjectKind

func (r RuleRes) GetObjectKind() schema.ObjectKind

GetObjectKind returns a schema object.

type Rules

type Rules []RuleRes

Rules represents a collection of rules.

func (Rules) Upsert

func (rr Rules) Upsert(r RuleRes) Rules

Upsert adds a new rule.

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.

func (ScreenDump) Header

func (ScreenDump) Header(ns string) model1.Header

Header returns a header row.

func (ScreenDump) Render

func (b ScreenDump) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type Secret added in v0.32.0

type Secret struct {
	Base
}

Secret renders a K8s Secret to screen.

func (Secret) Header added in v0.32.0

func (Secret) Header(string) model1.Header

Header returns a header rbw.

func (Secret) Render added in v0.32.0

func (n Secret) Render(o interface{}, _ string, r *model1.Row) error

Render renders a K8s resource to screen.

type Section added in v0.19.0

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 Sections added in v0.19.0

type Sections []Section

Sections represents a collection of sections.

type Service

type Service struct {
	Base
}

Service renders a K8s Service to screen.

func (Service) Header

func (Service) Header(ns string) model1.Header

Header returns a header row.

func (Service) Render

func (s Service) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type ServiceAccount

type ServiceAccount struct {
	Base
}

ServiceAccount renders a K8s ServiceAccount to screen.

func (ServiceAccount) Header

func (ServiceAccount) Header(ns string) model1.Header

Header returns a header row.

func (ServiceAccount) Render

func (s ServiceAccount) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type StatefulSet

type StatefulSet struct {
	Base
}

StatefulSet renders a K8s StatefulSet to screen.

func (StatefulSet) Header

func (StatefulSet) Header(ns string) model1.Header

Header returns a header row.

func (StatefulSet) Render

func (s StatefulSet) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

type StorageClass

type StorageClass struct {
	Base
}

StorageClass renders a K8s StorageClass to screen.

func (StorageClass) Header

func (StorageClass) Header(ns string) model1.Header

Header returns a header row.

func (StorageClass) Render

func (s StorageClass) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource 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.

func (Subject) Header

func (Subject) Header(ns string) model1.Header

Header returns a header row.

func (Subject) Render

func (s Subject) Render(o interface{}, ns string, r *model1.Row) error

Render renders a K8s resource to screen.

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 Tally added in v0.19.0

type Tally struct {
	OK, Info, Warning, Error int
	Count                    int
}

type Workload added in v0.30.0

type Workload struct {
	Base
}

Workload renders a workload to screen.

func (Workload) ColorerFunc added in v0.30.0

func (n Workload) ColorerFunc() model1.ColorerFunc

ColorerFunc colors a resource row.

func (Workload) Header added in v0.30.0

func (Workload) Header(string) model1.Header

Header returns a header rbw.

func (Workload) Render added in v0.30.0

func (n Workload) Render(o interface{}, _ string, r *model1.Row) error

Render renders a K8s resource to screen.

type WorkloadRes added in v0.30.0

type WorkloadRes struct {
	Row metav1.TableRow
}

func (*WorkloadRes) DeepCopyObject added in v0.30.0

func (a *WorkloadRes) DeepCopyObject() runtime.Object

DeepCopyObject returns a container copy.

func (*WorkloadRes) GetObjectKind added in v0.30.0

func (a *WorkloadRes) GetObjectKind() schema.ObjectKind

GetObjectKind returns a schema object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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