Documentation
¶
Index ¶
- Constants
- Variables
- func MustExtractFactory(ctx context.Context) types.Factory
- func MustExtractSectionGVR(ctx context.Context) types.GVR
- func WithGroup(ctx context.Context, gvr types.GVR, grp string) context.Context
- func WithSpec(ctx context.Context, spec rules.Spec) context.Context
- type Aliases
- func (a *Aliases) Dump()
- func (a *Aliases) Exclude(gvr types.GVR, sections []string) bool
- func (a *Aliases) Init(c types.Connection) error
- func (a *Aliases) Inject(ss ShortNames)
- func (a *Aliases) IsCiliumCluster() bool
- func (a *Aliases) IsNamespaced(gvr types.GVR) bool
- func (a *Aliases) Realize()
- func (a *Aliases) Singular(gvr types.GVR) string
- func (a *Aliases) TitleFor(s string, plural bool) string
- func (a *Aliases) ToResources(nn []string) []string
- type ContextKey
- type Empty
- type Linters
- type R
- type ResourceMetas
- type RunInfo
- type ShortNames
- type StringSet
Constants ¶
View Source
const All = "all"
All indicates all data keys are being used when referencing a cm or secret.
Variables ¶
View Source
var AllKeys = StringSet{All: Blank}
AllKeys indicates all keys are present.
View Source
var Blank = Empty{}
Blank represents an empty value.
View Source
var (
ClusterGVR = types.NewGVR("cluster")
)
View Source
var Glossary = make(Linters)
Functions ¶
func MustExtractFactory ¶ added in v0.20.0
func MustExtractSectionGVR ¶ added in v0.8.0
MustExtractSectionGVR extract section gvr from context or die.
Types ¶
type Aliases ¶
type Aliases struct {
// contains filtered or unexported fields
}
Aliases represents a collection of resource aliases.
func (*Aliases) Exclude ¶ added in v0.8.0
Exclude checks if section should be excluded from the report.
func (*Aliases) Init ¶ added in v0.8.0
func (a *Aliases) Init(c types.Connection) error
Init loads the aliases glossary.
func (*Aliases) Inject ¶ added in v0.21.0
func (a *Aliases) Inject(ss ShortNames)
func (*Aliases) IsCiliumCluster ¶ added in v0.21.0
func (*Aliases) ToResources ¶
ToResources converts aliases to resource names.
type ContextKey ¶ added in v0.8.0
type ContextKey string
ContextKey represents context key.
const ( KeyFactory ContextKey = "factory" KeyLabels ContextKey = "labels" KeyFields ContextKey = "fields" KeyOverAllocs ContextKey = "overAllocs" KeyRunInfo ContextKey = "runInfo" KeyConfig ContextKey = "config" KeyNamespace ContextKey = "namespace" KeyVersion ContextKey = "version" KeyDB ContextKey = "db" )
A collection of context keys.
type R ¶ added in v0.20.0
type R string
const ( CM R = "configmaps" CL R = "cluster" EP R = "endpoints" NS R = "namespaces" NO R = "nodes" PV R = "persistentvolumes" PVC R = "persistentvolumeclaims" PO R = "pods" SEC R = "secrets" SA R = "serviceaccounts" SVC R = "services" DP R = "deployments" DS R = "daemonsets" RS R = "replicasets" STS R = "statefulsets" CR R = "clusterroles" CRB R = "clusterrolebindings" RO R = "roles" ROB R = "rolebindings" ING R = "ingresses" NP R = "networkpolicies" PDB R = "poddisruptionbudgets" HPA R = "horizontalpodautoscalers" PMX R = "podmetrics" NMX R = "nodemetrics" CJOB R = "cronjobs" JOB R = "jobs" GW R = "gateways" GWC R = "gatewayclasses" GWR R = "httproutes" )
type ResourceMetas ¶ added in v0.8.0
type ResourceMetas map[types.GVR]metav1.APIResource
ResourceMetas represents a collection of resource metadata.
type RunInfo ¶
type RunInfo struct { Section string SectionGVR types.GVR Group string GroupGVR types.GVR Spec rules.Spec Total int }
RunInfo describes a scan run.
func MustExtractRunInfo ¶
MustExtractRunInfo extracts runinfo from context or die.
func NewRunInfo ¶ added in v0.20.0
type ShortNames ¶ added in v0.21.0
Click to show internal directories.
Click to hide internal directories.