Documentation
¶
Index ¶
- Constants
- Variables
- func CleanOlderTimeSeries(conn *sqlite.Conn, d time.Duration) error
- func DeflateLabelSelectorRequirement(in []metav1.LabelSelectorRequirement) []metav1.LabelSelectorRequirement
- func DeflateRulePolicies(in map[string]softwarecomposition.RulePolicy) map[string]softwarecomposition.RulePolicy
- func DeflateSortString(in []string) []string
- func DeflateStringer[T Stringer](in []T) []T
- func DeleteMetadata(conn *sqlite.Conn, path string, metadata runtime.Object) error
- func DeleteTimeSeriesContainerEntries(conn *sqlite.Conn, path string) error
- func IsPayloadFile(path string) bool
- func ListTimeSeriesContainers(conn *sqlite.Conn, path string) (map[string][]softwarecomposition.TimeSeriesContainers, error)
- func ListTimeSeriesKeys(conn *sqlite.Conn) ([]string, error)
- func NewApplicationProfileStorage(realStore StorageQuerier) storage.Interface
- func NewConfigurationScanSummaryStorage(realStore StorageQuerier) storage.Interface
- func NewGeneratedNetworkPolicyStorage(realStore StorageQuerier, nnStore storage.Interface) storage.Interface
- func NewKubernetesClient() (*kubernetes.Clientset, error)
- func NewNetworkNeighborhoodStorage(realStore StorageQuerier) storage.Interface
- func NewPool(path string, size int) *sqlitemigration.Pool
- func NewTestPool(dir string) *sqlitemigration.Pool
- func NewVulnerabilitySummaryStorage(realStore StorageQuerier) storage.Interface
- func ReadMetadata(conn *sqlite.Conn, path string) ([]byte, error)
- func ReplaceTimeSeriesContainerEntries(conn *sqlite.Conn, path, seriesID string, deleteTimeSeries []string, ...) error
- func WriteJSON(conn *sqlite.Conn, path string, metadataJSON []byte) error
- func WriteTimeSeriesEntry(conn *sqlite.Conn, ...) error
- type ApplicationProfileProcessor
- type ApplicationProfileStorage
- func (a ApplicationProfileStorage) CompactRevision() int64
- func (a ApplicationProfileStorage) Create(ctx context.Context, key string, obj, out runtime.Object, ttl uint64) error
- func (a ApplicationProfileStorage) Delete(ctx context.Context, key string, out runtime.Object, ...) error
- func (a ApplicationProfileStorage) Get(ctx context.Context, key string, opts storage.GetOptions, ...) error
- func (a ApplicationProfileStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
- func (a ApplicationProfileStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, ...) error
- func (a ApplicationProfileStorage) GuaranteedUpdate(ctx context.Context, key string, destination runtime.Object, ...) error
- func (a ApplicationProfileStorage) ReadinessCheck() error
- func (a ApplicationProfileStorage) RequestWatchProgress(ctx context.Context) error
- func (a ApplicationProfileStorage) SetKeysFunc(_ storage.KeysFunc)
- func (a ApplicationProfileStorage) Stats(_ context.Context) (storage.Stats, error)
- func (a ApplicationProfileStorage) Versioner() storage.Versioner
- func (a ApplicationProfileStorage) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error)
- type ConfigurationScanSummaryStorage
- func (s *ConfigurationScanSummaryStorage) CompactRevision() int64
- func (ConfigurationScanSummaryStorage) Count(key string) (int64, error)
- func (ConfigurationScanSummaryStorage) Create(_ context.Context, key string, _, _ runtime.Object, _ uint64) error
- func (ConfigurationScanSummaryStorage) Delete(_ context.Context, key string, _ runtime.Object, _ *storage.Preconditions, ...) error
- func (s *ConfigurationScanSummaryStorage) Get(ctx context.Context, key string, _ storage.GetOptions, objPtr runtime.Object) error
- func (s *ConfigurationScanSummaryStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
- func (s *ConfigurationScanSummaryStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, ...) error
- func (ConfigurationScanSummaryStorage) GuaranteedUpdate(_ context.Context, key string, _ runtime.Object, _ bool, ...) error
- func (ConfigurationScanSummaryStorage) ReadinessCheck() error
- func (ConfigurationScanSummaryStorage) RequestWatchProgress(context.Context) error
- func (s *ConfigurationScanSummaryStorage) SetKeysFunc(_ storage.KeysFunc)
- func (s *ConfigurationScanSummaryStorage) Stats(_ context.Context) (storage.Stats, error)
- func (ConfigurationScanSummaryStorage) Versioner() storage.Versioner
- func (ConfigurationScanSummaryStorage) Watch(_ context.Context, _ string, _ storage.ListOptions) (watch.Interface, error)
- type ContainerProfileProcessor
- func (a *ContainerProfileProcessor) AfterCreate(ctx context.Context, conn *sqlite.Conn, object runtime.Object) error
- func (a *ContainerProfileProcessor) PreSave(ctx context.Context, conn *sqlite.Conn, object runtime.Object) error
- func (a *ContainerProfileProcessor) SetStorage(storageImpl *StorageImpl)
- type DefaultProcessor
- type DirectIOReader
- type DirectIOWriter
- type GeneratedNetworkPolicyStorage
- func (s *GeneratedNetworkPolicyStorage) CompactRevision() int64
- func (GeneratedNetworkPolicyStorage) Count(key string) (int64, error)
- func (GeneratedNetworkPolicyStorage) Create(_ context.Context, key string, _, _ runtime.Object, _ uint64) error
- func (GeneratedNetworkPolicyStorage) Delete(_ context.Context, key string, _ runtime.Object, _ *storage.Preconditions, ...) error
- func (s *GeneratedNetworkPolicyStorage) Get(ctx context.Context, key string, opts storage.GetOptions, ...) error
- func (s *GeneratedNetworkPolicyStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
- func (s *GeneratedNetworkPolicyStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, ...) error
- func (GeneratedNetworkPolicyStorage) GuaranteedUpdate(_ context.Context, key string, _ runtime.Object, _ bool, ...) error
- func (GeneratedNetworkPolicyStorage) ReadinessCheck() error
- func (GeneratedNetworkPolicyStorage) RequestWatchProgress(context.Context) error
- func (s *GeneratedNetworkPolicyStorage) SetKeysFunc(_ storage.KeysFunc)
- func (s *GeneratedNetworkPolicyStorage) Stats(_ context.Context) (storage.Stats, error)
- func (GeneratedNetworkPolicyStorage) Versioner() storage.Versioner
- func (GeneratedNetworkPolicyStorage) Watch(_ context.Context, _ string, _ storage.ListOptions) (watch.Interface, error)
- type KubernetesAPI
- type NetworkNeighborhoodProcessor
- type NetworkNeighborhoodStorage
- func (a NetworkNeighborhoodStorage) CompactRevision() int64
- func (a NetworkNeighborhoodStorage) Create(ctx context.Context, key string, obj, out runtime.Object, ttl uint64) error
- func (a NetworkNeighborhoodStorage) Delete(ctx context.Context, key string, out runtime.Object, ...) error
- func (a NetworkNeighborhoodStorage) Get(ctx context.Context, key string, opts storage.GetOptions, ...) error
- func (a NetworkNeighborhoodStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
- func (a NetworkNeighborhoodStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, ...) error
- func (a NetworkNeighborhoodStorage) GuaranteedUpdate(ctx context.Context, key string, destination runtime.Object, ...) error
- func (a NetworkNeighborhoodStorage) ReadinessCheck() error
- func (a NetworkNeighborhoodStorage) RequestWatchProgress(ctx context.Context) error
- func (a NetworkNeighborhoodStorage) SetKeysFunc(_ storage.KeysFunc)
- func (a NetworkNeighborhoodStorage) Stats(_ context.Context) (storage.Stats, error)
- func (a NetworkNeighborhoodStorage) Versioner() storage.Versioner
- func (a NetworkNeighborhoodStorage) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error)
- type PartialObjectMetadata
- type Processor
- type ResourceMaps
- type ResourcesCleanupHandler
- type ResourcesFetcher
- type StorageImpl
- func (s *StorageImpl) CalculateChecksum(in runtime.Object) (string, error)
- func (s *StorageImpl) CompactRevision() int64
- func (s *StorageImpl) Count(key string) (int64, error)
- func (s *StorageImpl) Create(ctx context.Context, key string, obj, metaOut runtime.Object, _ uint64) error
- func (s *StorageImpl) CreateWithConn(ctx context.Context, conn *sqlite.Conn, key string, ...) error
- func (s *StorageImpl) Delete(ctx context.Context, key string, metaOut runtime.Object, ...) error
- func (s *StorageImpl) DeleteWithConn(ctx context.Context, conn *sqlite.Conn, key string, metaOut runtime.Object, ...) error
- func (s *StorageImpl) Get(ctx context.Context, key string, opts storage.GetOptions, ...) error
- func (s *StorageImpl) GetByCluster(ctx context.Context, apiVersion, kind string, listObj runtime.Object) error
- func (s *StorageImpl) GetByNamespace(ctx context.Context, apiVersion, kind, namespace string, ...) error
- func (s *StorageImpl) GetCurrentResourceVersion(_ context.Context) (uint64, error)
- func (s *StorageImpl) GetList(ctx context.Context, key string, opts storage.ListOptions, ...) error
- func (s *StorageImpl) GetListWithConn(ctx context.Context, conn *sqlite.Conn, key string, opts storage.ListOptions, ...) error
- func (s *StorageImpl) GetWithConn(ctx context.Context, conn *sqlite.Conn, key string, opts storage.GetOptions, ...) error
- func (s *StorageImpl) GuaranteedUpdate(ctx context.Context, key string, metaOut runtime.Object, ignoreNotFound bool, ...) error
- func (s *StorageImpl) GuaranteedUpdateWithConn(ctx context.Context, conn *sqlite.Conn, key string, metaOut runtime.Object, ...) error
- func (s *StorageImpl) ReadinessCheck() error
- func (s *StorageImpl) RequestWatchProgress(context.Context) error
- func (s *StorageImpl) SetKeysFunc(_ storage.KeysFunc)
- func (s *StorageImpl) Stats(_ context.Context) (storage.Stats, error)
- func (s *StorageImpl) Versioner() storage.Versioner
- func (s *StorageImpl) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error)
- type StorageQuerier
- type Stringer
- type TypeCleanupHandlerFunc
- type TypeDeleteFunc
- type VulnerabilitySummaryStorage
- func (s *VulnerabilitySummaryStorage) CompactRevision() int64
- func (VulnerabilitySummaryStorage) Count(key string) (int64, error)
- func (VulnerabilitySummaryStorage) Create(_ context.Context, key string, _, _ runtime.Object, _ uint64) error
- func (VulnerabilitySummaryStorage) Delete(_ context.Context, key string, _ runtime.Object, _ *storage.Preconditions, ...) error
- func (s *VulnerabilitySummaryStorage) Get(ctx context.Context, key string, _ storage.GetOptions, objPtr runtime.Object) error
- func (s *VulnerabilitySummaryStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
- func (s *VulnerabilitySummaryStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, ...) error
- func (VulnerabilitySummaryStorage) GuaranteedUpdate(_ context.Context, key string, _ runtime.Object, _ bool, ...) error
- func (VulnerabilitySummaryStorage) ReadinessCheck() error
- func (VulnerabilitySummaryStorage) RequestWatchProgress(context.Context) error
- func (s *VulnerabilitySummaryStorage) SetKeysFunc(_ storage.KeysFunc)
- func (s *VulnerabilitySummaryStorage) Stats(_ context.Context) (storage.Stats, error)
- func (VulnerabilitySummaryStorage) Versioner() storage.Versioner
- func (VulnerabilitySummaryStorage) Watch(_ context.Context, _ string, _ storage.ListOptions) (watch.Interface, error)
- type WatchDispatcher
Constants ¶
const ( OpenDynamicThreshold = 50 EndpointDynamicThreshold = 100 )
const ( GobExt = ".g" JsonExt = ".j" MetadataExt = ".m" DefaultStorageRoot = "/data" StorageV1Beta1ApiVersion = "spdx.softwarecomposition.kubescape.io/v1beta1" SchemaVersion = int64(1) )
const (
MinSizeToReport = 30 * 1024 * 1024 // 30MB
)
Variables ¶
var ( ObjectCompletedError = errors.New("object is completed") ObjectTooLargeError = errors.New("object is too large") )
var (
ErrMetadataNotFound = errors.New("metadata not found")
)
var ( Workloads = mapset.NewSet[string]([]string{ "cronjob", "daemonset", "deployment", "job", "replicaset", "statefulset", }...) // FIXME put in a configmap )
Functions ¶
func CleanOlderTimeSeries ¶ added in v0.0.199
CleanOlderTimeSeries cleans up time series containers which are older than d.
func DeflateLabelSelectorRequirement ¶ added in v0.0.199
func DeflateLabelSelectorRequirement(in []metav1.LabelSelectorRequirement) []metav1.LabelSelectorRequirement
func DeflateRulePolicies ¶ added in v0.0.135
func DeflateRulePolicies(in map[string]softwarecomposition.RulePolicy) map[string]softwarecomposition.RulePolicy
func DeflateSortString ¶ added in v0.0.135
func DeflateStringer ¶ added in v0.0.118
func DeflateStringer[T Stringer](in []T) []T
func DeleteMetadata ¶ added in v0.0.137
DeleteMetadata deletes metadata for the given path and unmarshals the deleted metadata into the provided runtime.Object.
func DeleteTimeSeriesContainerEntries ¶ added in v0.0.199
DeleteTimeSeriesContainerEntries deletes all time series entries for a completed container.
func IsPayloadFile ¶ added in v0.0.137
IsPayloadFile returns true if a given file at `path` is an object payload file, else false
func ListTimeSeriesContainers ¶ added in v0.0.199
func ListTimeSeriesContainers(conn *sqlite.Conn, path string) (map[string][]softwarecomposition.TimeSeriesContainers, error)
ListTimeSeriesContainers retrieves time series containers for a given path.
func ListTimeSeriesKeys ¶ added in v0.0.199
ListTimeSeriesKeys retrieves all time series keys that have data.
func NewApplicationProfileStorage ¶ added in v0.0.199
func NewApplicationProfileStorage(realStore StorageQuerier) storage.Interface
func NewConfigurationScanSummaryStorage ¶ added in v0.0.18
func NewConfigurationScanSummaryStorage(realStore StorageQuerier) storage.Interface
func NewGeneratedNetworkPolicyStorage ¶ added in v0.0.33
func NewGeneratedNetworkPolicyStorage(realStore StorageQuerier, nnStore storage.Interface) storage.Interface
func NewKubernetesClient ¶ added in v0.0.199
func NewKubernetesClient() (*kubernetes.Clientset, error)
func NewNetworkNeighborhoodStorage ¶ added in v0.0.199
func NewNetworkNeighborhoodStorage(realStore StorageQuerier) storage.Interface
func NewPool ¶ added in v0.0.137
func NewPool(path string, size int) *sqlitemigration.Pool
NewPool creates a new SQLite connection pool at the given path. It returns an error if the connection cannot be opened or the database cannot be initialized. It is your responsibility to call conn.Close() when you no longer need conn.
func NewTestPool ¶ added in v0.0.137
func NewTestPool(dir string) *sqlitemigration.Pool
NewTestPool creates a new temporary SQLite connection (for testing only).
func NewVulnerabilitySummaryStorage ¶ added in v0.0.20
func NewVulnerabilitySummaryStorage(realStore StorageQuerier) storage.Interface
func ReadMetadata ¶ added in v0.0.137
ReadMetadata reads metadata for the given path and returns it as a byte slice.
func ReplaceTimeSeriesContainerEntries ¶ added in v0.0.199
func ReplaceTimeSeriesContainerEntries(conn *sqlite.Conn, path, seriesID string, deleteTimeSeries []string, newTimeSeries []softwarecomposition.TimeSeriesContainers) error
ReplaceTimeSeriesContainerEntries replaces time series entries for a given path and seriesID.
Types ¶
type ApplicationProfileProcessor ¶ added in v0.0.66
type ApplicationProfileProcessor struct {
// contains filtered or unexported fields
}
func NewApplicationProfileProcessor ¶ added in v0.0.121
func NewApplicationProfileProcessor(cfg config.Config) *ApplicationProfileProcessor
func (*ApplicationProfileProcessor) AfterCreate ¶ added in v0.0.199
func (*ApplicationProfileProcessor) SetStorage ¶ added in v0.0.143
func (a *ApplicationProfileProcessor) SetStorage(storageImpl *StorageImpl)
type ApplicationProfileStorage ¶ added in v0.0.199
type ApplicationProfileStorage struct {
// contains filtered or unexported fields
}
func (ApplicationProfileStorage) CompactRevision ¶ added in v0.0.221
func (a ApplicationProfileStorage) CompactRevision() int64
func (ApplicationProfileStorage) Delete ¶ added in v0.0.199
func (a ApplicationProfileStorage) Delete(ctx context.Context, key string, out runtime.Object, preconditions *storage.Preconditions, validateDeletion storage.ValidateObjectFunc, cachedExistingObject runtime.Object, opts storage.DeleteOptions) error
func (ApplicationProfileStorage) Get ¶ added in v0.0.199
func (a ApplicationProfileStorage) Get(ctx context.Context, key string, opts storage.GetOptions, objPtr runtime.Object) error
func (ApplicationProfileStorage) GetCurrentResourceVersion ¶ added in v0.0.199
func (a ApplicationProfileStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
func (ApplicationProfileStorage) GetList ¶ added in v0.0.199
func (a ApplicationProfileStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error
func (ApplicationProfileStorage) GuaranteedUpdate ¶ added in v0.0.199
func (a ApplicationProfileStorage) GuaranteedUpdate(ctx context.Context, key string, destination runtime.Object, ignoreNotFound bool, preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, cachedExistingObject runtime.Object) error
func (ApplicationProfileStorage) ReadinessCheck ¶ added in v0.0.199
func (a ApplicationProfileStorage) ReadinessCheck() error
func (ApplicationProfileStorage) RequestWatchProgress ¶ added in v0.0.199
func (a ApplicationProfileStorage) RequestWatchProgress(ctx context.Context) error
func (ApplicationProfileStorage) SetKeysFunc ¶ added in v0.0.221
func (a ApplicationProfileStorage) SetKeysFunc(_ storage.KeysFunc)
func (ApplicationProfileStorage) Versioner ¶ added in v0.0.199
func (a ApplicationProfileStorage) Versioner() storage.Versioner
type ConfigurationScanSummaryStorage ¶ added in v0.0.18
type ConfigurationScanSummaryStorage struct {
// contains filtered or unexported fields
}
ConfigurationScanSummaryStorage offers a storage solution for ConfigurationScanSummary objects, implementing custom business logic for these objects and using the underlying default storage implementation.
func (*ConfigurationScanSummaryStorage) CompactRevision ¶ added in v0.0.221
func (s *ConfigurationScanSummaryStorage) CompactRevision() int64
func (ConfigurationScanSummaryStorage) Count ¶ added in v0.0.18
Count is not supported for immutable objects. Objects are generated on the fly and not stored.
func (ConfigurationScanSummaryStorage) Create ¶ added in v0.0.18
func (ConfigurationScanSummaryStorage) Create(_ context.Context, key string, _, _ runtime.Object, _ uint64) error
Create is not supported for immutable objects. Objects are generated on the fly and not stored.
func (ConfigurationScanSummaryStorage) Delete ¶ added in v0.0.18
func (ConfigurationScanSummaryStorage) Delete(_ context.Context, key string, _ runtime.Object, _ *storage.Preconditions, _ storage.ValidateObjectFunc, _ runtime.Object, _ storage.DeleteOptions) error
Delete is not supported for immutable objects. Objects are generated on the fly and not stored.
func (*ConfigurationScanSummaryStorage) Get ¶ added in v0.0.18
func (s *ConfigurationScanSummaryStorage) Get(ctx context.Context, key string, _ storage.GetOptions, objPtr runtime.Object) error
Get generates and returns a single ConfigurationScanSummary object for a namespace
func (*ConfigurationScanSummaryStorage) GetCurrentResourceVersion ¶ added in v0.0.199
func (s *ConfigurationScanSummaryStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
func (*ConfigurationScanSummaryStorage) GetList ¶ added in v0.0.18
func (s *ConfigurationScanSummaryStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error
GetList generates and returns a list of ConfigurationScanSummary objects for the cluster
func (ConfigurationScanSummaryStorage) GuaranteedUpdate ¶ added in v0.0.18
func (ConfigurationScanSummaryStorage) GuaranteedUpdate(_ context.Context, key string, _ runtime.Object, _ bool, _ *storage.Preconditions, _ storage.UpdateFunc, _ runtime.Object) error
GuaranteedUpdate is not supported for immutable objects. Objects are generated on the fly and not stored.
func (ConfigurationScanSummaryStorage) ReadinessCheck ¶ added in v0.0.174
func (ConfigurationScanSummaryStorage) ReadinessCheck() error
func (ConfigurationScanSummaryStorage) RequestWatchProgress ¶ added in v0.0.42
RequestWatchProgress fulfills the storage.Interface
It’s function is only relevant to etcd.
func (*ConfigurationScanSummaryStorage) SetKeysFunc ¶ added in v0.0.221
func (s *ConfigurationScanSummaryStorage) SetKeysFunc(_ storage.KeysFunc)
type ContainerProfileProcessor ¶ added in v0.0.199
type ContainerProfileProcessor struct {
// contains filtered or unexported fields
}
func NewContainerProfileProcessor ¶ added in v0.0.199
func NewContainerProfileProcessor(cfg config.Config, conn *sqlitemigration.Pool, cleanupHandler *ResourcesCleanupHandler) *ContainerProfileProcessor
func (*ContainerProfileProcessor) AfterCreate ¶ added in v0.0.199
func (a *ContainerProfileProcessor) AfterCreate(ctx context.Context, conn *sqlite.Conn, object runtime.Object) error
AfterCreate is called after a TS ContainerProfile is created to store metadata in SQLite.
func (*ContainerProfileProcessor) SetStorage ¶ added in v0.0.199
func (a *ContainerProfileProcessor) SetStorage(storageImpl *StorageImpl)
type DefaultProcessor ¶ added in v0.0.66
type DefaultProcessor struct {
}
func (DefaultProcessor) AfterCreate ¶ added in v0.0.199
func (DefaultProcessor) SetStorage ¶ added in v0.0.143
func (d DefaultProcessor) SetStorage(_ *StorageImpl)
type DirectIOReader ¶ added in v0.0.121
type DirectIOReader struct {
// contains filtered or unexported fields
}
DirectIOReader is a reader that reads data from the underlying reader using direct I/O.
func NewDirectIOReader ¶ added in v0.0.121
func NewDirectIOReader(rd io.Reader) *DirectIOReader
func (*DirectIOReader) Read ¶ added in v0.0.121
func (d *DirectIOReader) Read(p []byte) (int, error)
func (*DirectIOReader) ReadByte ¶ added in v0.0.121
func (d *DirectIOReader) ReadByte() (byte, error)
type DirectIOWriter ¶ added in v0.0.127
type DirectIOWriter struct {
// contains filtered or unexported fields
}
DirectIOWriter is a writer that writes data to the underlying writer using direct I/O.
func NewDirectIOWriter ¶ added in v0.0.127
func NewDirectIOWriter(wr afero.File) *DirectIOWriter
func (*DirectIOWriter) Close ¶ added in v0.0.127
func (d *DirectIOWriter) Close() error
type GeneratedNetworkPolicyStorage ¶ added in v0.0.33
type GeneratedNetworkPolicyStorage struct {
// contains filtered or unexported fields
}
GeneratedNetworkPolicyStorage offers a storage solution for GeneratedNetworkPolicy objects, implementing custom business logic for these objects and using the underlying default storage implementation.
func (*GeneratedNetworkPolicyStorage) CompactRevision ¶ added in v0.0.221
func (s *GeneratedNetworkPolicyStorage) CompactRevision() int64
func (GeneratedNetworkPolicyStorage) Count ¶ added in v0.0.33
Count is not supported for immutable objects. Objects are generated on the fly and not stored.
func (GeneratedNetworkPolicyStorage) Create ¶ added in v0.0.33
func (GeneratedNetworkPolicyStorage) Create(_ context.Context, key string, _, _ runtime.Object, _ uint64) error
Create is not supported for immutable objects. Objects are generated on the fly and not stored.
func (GeneratedNetworkPolicyStorage) Delete ¶ added in v0.0.33
func (GeneratedNetworkPolicyStorage) Delete(_ context.Context, key string, _ runtime.Object, _ *storage.Preconditions, _ storage.ValidateObjectFunc, _ runtime.Object, _ storage.DeleteOptions) error
Delete is not supported for immutable objects. Objects are generated on the fly and not stored.
func (*GeneratedNetworkPolicyStorage) Get ¶ added in v0.0.33
func (s *GeneratedNetworkPolicyStorage) Get(ctx context.Context, key string, opts storage.GetOptions, objPtr runtime.Object) error
Get generates and returns a single GeneratedNetworkPolicy object
func (*GeneratedNetworkPolicyStorage) GetCurrentResourceVersion ¶ added in v0.0.199
func (s *GeneratedNetworkPolicyStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
func (*GeneratedNetworkPolicyStorage) GetList ¶ added in v0.0.33
func (s *GeneratedNetworkPolicyStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error
GetList generates and returns a list of GeneratedNetworkPolicy objects for the given namespace
func (GeneratedNetworkPolicyStorage) GuaranteedUpdate ¶ added in v0.0.33
func (GeneratedNetworkPolicyStorage) GuaranteedUpdate(_ context.Context, key string, _ runtime.Object, _ bool, _ *storage.Preconditions, _ storage.UpdateFunc, _ runtime.Object) error
GuaranteedUpdate is not supported for immutable objects. Objects are generated on the fly and not stored.
func (GeneratedNetworkPolicyStorage) ReadinessCheck ¶ added in v0.0.174
func (GeneratedNetworkPolicyStorage) ReadinessCheck() error
func (GeneratedNetworkPolicyStorage) RequestWatchProgress ¶ added in v0.0.42
RequestWatchProgress fulfills the storage.Interface
It’s function is only relevant to etcd.
func (*GeneratedNetworkPolicyStorage) SetKeysFunc ¶ added in v0.0.221
func (s *GeneratedNetworkPolicyStorage) SetKeysFunc(_ storage.KeysFunc)
type KubernetesAPI ¶ added in v0.0.199
type KubernetesAPI struct {
// contains filtered or unexported fields
}
func NewKubernetesAPI ¶ added in v0.0.199
func NewKubernetesAPI(cfg config.Config, client *kubernetes.Clientset) *KubernetesAPI
func (*KubernetesAPI) FetchResources ¶ added in v0.0.199
func (h *KubernetesAPI) FetchResources(ns string) (ResourceMaps, error)
FetchResources builds a map of running resources in the cluster needed for cleanup
func (*KubernetesAPI) ListNamespaces ¶ added in v0.0.214
func (h *KubernetesAPI) ListNamespaces(conn *sqlite.Conn) ([]string, error)
type NetworkNeighborhoodProcessor ¶ added in v0.0.81
type NetworkNeighborhoodProcessor struct {
// contains filtered or unexported fields
}
func NewNetworkNeighborhoodProcessor ¶ added in v0.0.121
func NewNetworkNeighborhoodProcessor(cfg config.Config) *NetworkNeighborhoodProcessor
func (NetworkNeighborhoodProcessor) AfterCreate ¶ added in v0.0.199
func (NetworkNeighborhoodProcessor) SetStorage ¶ added in v0.0.143
func (a NetworkNeighborhoodProcessor) SetStorage(_ *StorageImpl)
type NetworkNeighborhoodStorage ¶ added in v0.0.199
type NetworkNeighborhoodStorage struct {
// contains filtered or unexported fields
}
func (NetworkNeighborhoodStorage) CompactRevision ¶ added in v0.0.221
func (a NetworkNeighborhoodStorage) CompactRevision() int64
func (NetworkNeighborhoodStorage) Delete ¶ added in v0.0.199
func (a NetworkNeighborhoodStorage) Delete(ctx context.Context, key string, out runtime.Object, preconditions *storage.Preconditions, validateDeletion storage.ValidateObjectFunc, cachedExistingObject runtime.Object, opts storage.DeleteOptions) error
func (NetworkNeighborhoodStorage) Get ¶ added in v0.0.199
func (a NetworkNeighborhoodStorage) Get(ctx context.Context, key string, opts storage.GetOptions, objPtr runtime.Object) error
func (NetworkNeighborhoodStorage) GetCurrentResourceVersion ¶ added in v0.0.199
func (a NetworkNeighborhoodStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
func (NetworkNeighborhoodStorage) GetList ¶ added in v0.0.199
func (a NetworkNeighborhoodStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error
func (NetworkNeighborhoodStorage) GuaranteedUpdate ¶ added in v0.0.199
func (a NetworkNeighborhoodStorage) GuaranteedUpdate(ctx context.Context, key string, destination runtime.Object, ignoreNotFound bool, preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, cachedExistingObject runtime.Object) error
func (NetworkNeighborhoodStorage) ReadinessCheck ¶ added in v0.0.199
func (a NetworkNeighborhoodStorage) ReadinessCheck() error
func (NetworkNeighborhoodStorage) RequestWatchProgress ¶ added in v0.0.199
func (a NetworkNeighborhoodStorage) RequestWatchProgress(ctx context.Context) error
func (NetworkNeighborhoodStorage) SetKeysFunc ¶ added in v0.0.221
func (a NetworkNeighborhoodStorage) SetKeysFunc(_ storage.KeysFunc)
func (NetworkNeighborhoodStorage) Versioner ¶ added in v0.0.199
func (a NetworkNeighborhoodStorage) Versioner() storage.Versioner
type PartialObjectMetadata ¶ added in v0.0.199
type PartialObjectMetadata struct {
metav1.TypeMeta
metav1.ObjectMeta
}
PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients to get access to a particular ObjectMeta schema without knowing the details of the version.
func (PartialObjectMetadata) DeepCopyObject ¶ added in v0.0.199
func (p PartialObjectMetadata) DeepCopyObject() runtime.Object
type ResourceMaps ¶ added in v0.0.199
type ResourceMaps struct {
// CLUSTER level
RunningContainerImageIds mapset.Set[string]
RunningInstanceIds mapset.Set[string]
// NAMESPACE level
RunningTemplateHash mapset.Set[string]
RunningWlidsToContainerNames *maps.SafeMap[string, mapset.Set[string]]
}
ResourceMaps is a map of running resources in the cluster, based on these maps we can decide which files to delete
type ResourcesCleanupHandler ¶ added in v0.0.199
type ResourcesCleanupHandler struct {
// contains filtered or unexported fields
}
func NewResourcesCleanupHandler ¶ added in v0.0.199
func NewResourcesCleanupHandler(appFs afero.Fs, root string, pool *sqlitemigration.Pool, watchDispatcher *WatchDispatcher, interval time.Duration, defaultNamespace string, fetcher ResourcesFetcher, relevancyEnabled bool) *ResourcesCleanupHandler
func (*ResourcesCleanupHandler) CleanupTask ¶ added in v0.0.199
func (h *ResourcesCleanupHandler) CleanupTask(ctx context.Context, resourceToKindHandler map[string][]TypeCleanupHandlerFunc) error
func (*ResourcesCleanupHandler) RunCleanupTask ¶ added in v0.0.199
func (h *ResourcesCleanupHandler) RunCleanupTask(ctx context.Context)
type ResourcesFetcher ¶ added in v0.0.199
type StorageImpl ¶
type StorageImpl struct {
// contains filtered or unexported fields
}
StorageImpl offers a common interface for object marshaling/unmarshaling operations and hides all the storage-related operations behind it.
func (*StorageImpl) CalculateChecksum ¶ added in v0.0.135
func (s *StorageImpl) CalculateChecksum(in runtime.Object) (string, error)
func (*StorageImpl) CompactRevision ¶ added in v0.0.221
func (s *StorageImpl) CompactRevision() int64
func (*StorageImpl) Count ¶
func (s *StorageImpl) Count(key string) (int64, error)
Count returns number of different entries under the key (generally being path prefix).
func (*StorageImpl) Create ¶
func (s *StorageImpl) Create(ctx context.Context, key string, obj, metaOut runtime.Object, _ uint64) error
Create adds a new object at a key unless it already exists. 'ttl' is time-to-live in seconds (and is ignored). If no error is returned and out is not nil, out will be set to the read value from database.
func (*StorageImpl) CreateWithConn ¶ added in v0.0.199
func (*StorageImpl) Delete ¶
func (s *StorageImpl) Delete(ctx context.Context, key string, metaOut runtime.Object, _ *storage.Preconditions, _ storage.ValidateObjectFunc, _ runtime.Object, _ storage.DeleteOptions) error
Delete removes the specified key and returns the value that existed at that spot. If key didn't exist, it will return NotFound storage error. If 'cachedExistingObject' is non-nil, it can be used as a suggestion about the current version of the object to avoid read operation from storage to get it. However, the implementations have to retry in case suggestion is stale.
func (*StorageImpl) DeleteWithConn ¶ added in v0.0.199
func (s *StorageImpl) DeleteWithConn(ctx context.Context, conn *sqlite.Conn, key string, metaOut runtime.Object, _ *storage.Preconditions, _ storage.ValidateObjectFunc, _ runtime.Object, _ storage.DeleteOptions) error
func (*StorageImpl) Get ¶
func (s *StorageImpl) Get(ctx context.Context, key string, opts storage.GetOptions, objPtr runtime.Object) error
Get unmarshals object found at key into objPtr. On a not found error, will either return a zero object of the requested type, or an error, depending on 'opts.ignoreNotFound'. Treats empty responses and nil response nodes exactly like a not found error. The returned contents may be delayed, but it is guaranteed that they will match 'opts.ResourceVersion' according 'opts.ResourceVersionMatch'.
func (*StorageImpl) GetByCluster ¶ added in v0.0.18
func (s *StorageImpl) GetByCluster(ctx context.Context, apiVersion, kind string, listObj runtime.Object) error
GetByCluster returns all objects in a given cluster, given their api version and kind.
func (*StorageImpl) GetByNamespace ¶ added in v0.0.18
func (s *StorageImpl) GetByNamespace(ctx context.Context, apiVersion, kind, namespace string, listObj runtime.Object) error
GetByNamespace returns all objects in a given namespace, given their api version and kind.
func (*StorageImpl) GetCurrentResourceVersion ¶ added in v0.0.199
func (s *StorageImpl) GetCurrentResourceVersion(_ context.Context) (uint64, error)
func (*StorageImpl) GetList ¶
func (s *StorageImpl) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error
GetList unmarshalls objects found at key into a *List api object (an object that satisfies runtime.IsList definition). If 'opts.Recursive' is false, 'key' is used as an exact match. If `opts.Recursive' is true, 'key' is used as a prefix. The returned contents may be delayed, but it is guaranteed that they will match 'opts.ResourceVersion' according 'opts.ResourceVersionMatch'. GetList only returns metadata for the objects, not the objects themselves.
func (*StorageImpl) GetListWithConn ¶ added in v0.0.199
func (*StorageImpl) GetWithConn ¶ added in v0.0.199
func (*StorageImpl) GuaranteedUpdate ¶
func (s *StorageImpl) GuaranteedUpdate( ctx context.Context, key string, metaOut runtime.Object, ignoreNotFound bool, preconditions *storage.Preconditions, tryUpdate storage.UpdateFunc, cachedExistingObject runtime.Object) error
GuaranteedUpdate keeps calling 'tryUpdate()' to update key 'key' (of type 'destination') retrying the update until success if there is index conflict. Note that object passed to tryUpdate may change across invocations of tryUpdate() if other writers are simultaneously updating it, so tryUpdate() needs to take into account the current contents of the object when deciding how the update object should look. If the key doesn't exist, it will return NotFound storage error if ignoreNotFound=false else `destination` will be set to the zero value of its type. If the eventual successful invocation of `tryUpdate` returns an output with the same serialized contents as the input, it won't perform any update, but instead set `destination` to an object with those contents. If 'cachedExistingObject' is non-nil, it can be used as a suggestion about the current version of the object to avoid read operation from storage to get it. However, the implementations have to retry in case suggestion is stale.
Example:
s := /* implementation of Interface */ err := s.GuaranteedUpdate(
"myKey", &MyType{}, true, preconditions,
func(input runtime.Object, res ResponseMeta) (runtime.Object, *uint64, error) {
// Before each invocation of the user defined function, "input" is reset to
// current contents for "myKey" in database.
curr := input.(*MyType) // Guaranteed to succeed.
// Make the modification
curr.Counter++
// Return the modified object - return an error to stop iterating. Return
// a uint64 to alter the TTL on the object, or nil to keep it the same value.
return cur, nil, nil
}, cachedExistingObject
)
func (*StorageImpl) GuaranteedUpdateWithConn ¶ added in v0.0.199
func (*StorageImpl) ReadinessCheck ¶ added in v0.0.174
func (s *StorageImpl) ReadinessCheck() error
func (*StorageImpl) RequestWatchProgress ¶ added in v0.0.42
func (s *StorageImpl) RequestWatchProgress(context.Context) error
RequestWatchProgress fulfills the storage.Interface
Its function is only relevant to etcd.
func (*StorageImpl) SetKeysFunc ¶ added in v0.0.221
func (s *StorageImpl) SetKeysFunc(_ storage.KeysFunc)
func (*StorageImpl) Versioner ¶
func (s *StorageImpl) Versioner() storage.Versioner
Versioner Returns Versioner associated with this interface.
func (*StorageImpl) Watch ¶
func (s *StorageImpl) Watch(ctx context.Context, key string, opts storage.ListOptions) (watch.Interface, error)
Watch begins watching the specified key. Events are decoded into API objects, and any items selected by 'p' are sent down to returned watch.Interface. resourceVersion may be used to specify what version to begin watching, which should be the current resourceVersion, and no longer rv+1 (e.g. reconnecting without missing any updates). If resource version is "0", this interface will get current object at given key and send it in an "ADDED" event, before watch starts.
type StorageQuerier ¶ added in v0.0.18
type StorageQuerier interface {
storage.Interface
CalculateChecksum(in runtime.Object) (string, error)
GetByNamespace(ctx context.Context, apiVersion, kind, namespace string, listObj runtime.Object) error
GetByCluster(ctx context.Context, apiVersion, kind string, listObj runtime.Object) error
}
StorageQuerier wraps the storage.Interface and adds some extra methods which are used by the storage implementation.
func NewStorageImpl ¶
func NewStorageImpl(appFs afero.Fs, root string, pool *sqlitemigration.Pool, watchDispatcher *WatchDispatcher, scheme *runtime.Scheme) StorageQuerier
func NewStorageImplWithCollector ¶ added in v0.0.66
func NewStorageImplWithCollector(appFs afero.Fs, root string, conn *sqlitemigration.Pool, watchDispatcher *WatchDispatcher, scheme *runtime.Scheme, processor Processor) StorageQuerier
type TypeCleanupHandlerFunc ¶ added in v0.0.199
type TypeCleanupHandlerFunc func(kind, path string, metadata *metav1.ObjectMeta, resourceMaps ResourceMaps) bool
type TypeDeleteFunc ¶ added in v0.0.199
type VulnerabilitySummaryStorage ¶ added in v0.0.20
type VulnerabilitySummaryStorage struct {
// contains filtered or unexported fields
}
VulnerabilitySummaryStorage implements a storage for vulnerability summaries.
It provides vulnerability summaries for scopes like namespace and cluster. To get these summaries, the storage fetches existing stored VulnerabilitySummary objects and aggregates them on the fly.
func (*VulnerabilitySummaryStorage) CompactRevision ¶ added in v0.0.221
func (s *VulnerabilitySummaryStorage) CompactRevision() int64
func (VulnerabilitySummaryStorage) Count ¶ added in v0.0.20
Count is not supported for immutable objects. Objects are generated on the fly and not stored.
func (VulnerabilitySummaryStorage) Create ¶ added in v0.0.20
func (VulnerabilitySummaryStorage) Create(_ context.Context, key string, _, _ runtime.Object, _ uint64) error
Create is not supported for immutable objects. Objects are generated on the fly and not stored.
func (VulnerabilitySummaryStorage) Delete ¶ added in v0.0.20
func (VulnerabilitySummaryStorage) Delete(_ context.Context, key string, _ runtime.Object, _ *storage.Preconditions, _ storage.ValidateObjectFunc, _ runtime.Object, _ storage.DeleteOptions) error
Delete is not supported for immutable objects. Objects are generated on the fly and not stored.
func (*VulnerabilitySummaryStorage) Get ¶ added in v0.0.20
func (s *VulnerabilitySummaryStorage) Get(ctx context.Context, key string, _ storage.GetOptions, objPtr runtime.Object) error
func (*VulnerabilitySummaryStorage) GetCurrentResourceVersion ¶ added in v0.0.199
func (s *VulnerabilitySummaryStorage) GetCurrentResourceVersion(_ context.Context) (uint64, error)
func (*VulnerabilitySummaryStorage) GetList ¶ added in v0.0.20
func (s *VulnerabilitySummaryStorage) GetList(ctx context.Context, key string, opts storage.ListOptions, listObj runtime.Object) error
func (VulnerabilitySummaryStorage) GuaranteedUpdate ¶ added in v0.0.20
func (VulnerabilitySummaryStorage) GuaranteedUpdate(_ context.Context, key string, _ runtime.Object, _ bool, _ *storage.Preconditions, _ storage.UpdateFunc, _ runtime.Object) error
GuaranteedUpdate is not supported for immutable objects. Objects are generated on the fly and not stored.
func (VulnerabilitySummaryStorage) ReadinessCheck ¶ added in v0.0.174
func (VulnerabilitySummaryStorage) ReadinessCheck() error
func (VulnerabilitySummaryStorage) RequestWatchProgress ¶ added in v0.0.42
RequestWatchProgress fulfills the storage.Interface
It’s function is only relevant to etcd.
func (*VulnerabilitySummaryStorage) SetKeysFunc ¶ added in v0.0.221
func (s *VulnerabilitySummaryStorage) SetKeysFunc(_ storage.KeysFunc)
type WatchDispatcher ¶ added in v0.0.160
type WatchDispatcher struct {
// contains filtered or unexported fields
}
WatchDispatcher dispatches events to registered watches
TODO(ttimonen): There's currently no way to gracefully take down WatchDispatcher without leaking a goroutine.
func NewWatchDispatcher ¶ added in v0.0.160
func NewWatchDispatcher() *WatchDispatcher
func (*WatchDispatcher) Added ¶ added in v0.0.160
func (wd *WatchDispatcher) Added(key string, metaOut, obj runtime.Object)
Added dispatches an "Added" event to appropriate watchers
func (*WatchDispatcher) Deleted ¶ added in v0.0.160
func (wd *WatchDispatcher) Deleted(key string, metaOut runtime.Object)
Deleted dispatches a "Deleted" event to appropriate watchers
func (*WatchDispatcher) Modified ¶ added in v0.0.160
func (wd *WatchDispatcher) Modified(key string, metaOut, obj runtime.Object)
Modified dispatches a "Modified" event to appropriate watchers
func (*WatchDispatcher) Register ¶ added in v0.0.160
func (wd *WatchDispatcher) Register(key string, w *watcher)
Register registers a watcher for a given key
Source Files
¶
- applicationprofile_processor.go
- applicationprofile_storage.go
- cleanup.go
- configurationscansummarystorage.go
- containerprofile_processor.go
- directio.go
- discovery.go
- generatednetworkpolicy.go
- networkneighborhood_processor.go
- networkneighborhood_storage.go
- processor.go
- sqlite.go
- storage.go
- utils.go
- vulnerabilitysummarystorage.go
- watch.go