Documentation
¶
Overview ¶
Package operator provides primitives for implementing Trivy-Operator Operator.
Index ¶
Constants ¶
const ( K8sRepo = "kubernetes" K8sRegistry = "k8s.io" )
Variables ¶
This section is empty.
Functions ¶
func CacheTransform ¶ added in v0.35.0
func CacheTransform() toolscache.TransformFunc
CacheTransform returns the transform applied to every object entering the operator's shared informer cache. It strips managed fields, the last-applied-configuration annotation and the Data and BinaryData of every ConfigMap, all of which keep the cache small.
ConfigMap contents are stripped even though ConfigMap is in ClientCacheOptions' DisableFor list, because the two settings act on different paths. DisableFor only changes where reads through the manager client go; it does not stop the informers. Config-audit, ChecksLoader and PolicyConfigController all watch ConfigMaps, so without this transform the informer store would hold the contents of every watched ConfigMap in memory while nothing ever read them from there.
Stripping is therefore safe: every ConfigMap read through the manager client - including the object config-audit serializes into Rego - is served by the API server and carries full contents.
func ClientCacheOptions ¶ added in v0.35.0
func ClientCacheOptions() *client.CacheOptions
ClientCacheOptions returns the cache configuration for the manager's client, listing the object types whose reads bypass the shared informer cache and go straight to the API server.
Secret and ServiceAccount are listed because their contents are never served from the cache. ConfigMap is listed because CacheTransform strips ConfigMap contents on the way in, so a cached read would return an object with no Data.
Both Start and the envtest suite configure their manager from this function, so the tests exercise the production configuration instead of a copy that can drift. Each call returns independent values, including a new DisableFor slice, so one caller cannot mutate the configuration used by another.
Types ¶
type ClusterController ¶ added in v0.18.0
type ClusterController struct {
logr.Logger
*vc.WorkloadController
// contains filtered or unexported fields
}
ClusterReconciler reconciles corev1.Node and corev1.Pod objects
to collect cluster nodes and cluster core components (api-server,kubelet,etcd and more) information for vulnerability scanning the node information will be evaluated by the compliance control checks per relevant reports, examples: cis-benchmark and nsa
func (*ClusterController) SetupWithManager ¶ added in v0.18.0
func (r *ClusterController) SetupWithManager(mgr ctrl.Manager) error
type TTLReportReconciler ¶ added in v0.5.0
type TTLReportReconciler struct {
logr.Logger
etc.Config
PolicyLoader policy.Loader
trivyoperator.PluginContext
client.Client
configauditreport.PluginInMemory
ext.Clock
}
func (*TTLReportReconciler) DeleteReportIfExpired ¶ added in v0.5.0
func (*TTLReportReconciler) SetupWithManager ¶ added in v0.5.0
func (r *TTLReportReconciler) SetupWithManager(mgr ctrl.Manager) error