Documentation
¶
Index ¶
Constants ¶
View Source
const (
MinSizeToReport = 30 * 1024 * 1024 // 30MB
)
Variables ¶
View Source
var ( Workloads = mapset.NewSet[string]([]string{ "cronjob", "daemonset", "deployment", "job", "pod", "replicaset", "service", "statefulset", }...) // FIXME put in a configmap )
Functions ¶
func NewKubernetesClient ¶
func NewKubernetesClient() (dynamic.Interface, discovery.DiscoveryInterface, error)
Types ¶
type KubernetesAPI ¶
type KubernetesAPI struct {
// contains filtered or unexported fields
}
func NewKubernetesAPI ¶
func NewKubernetesAPI(cfg config.Config, client dynamic.Interface, discovery discovery.DiscoveryInterface) *KubernetesAPI
func (*KubernetesAPI) FetchResources ¶
func (h *KubernetesAPI) FetchResources() (ResourceMaps, error)
FetchResources builds a map of running resources in the cluster needed for cleanup
type PartialObjectMetadata ¶ added in v0.0.160
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.160
func (p PartialObjectMetadata) DeepCopyObject() runtime.Object
type PathVersion ¶ added in v0.0.178
TEMPORARY CODE
type ResourceMaps ¶
type ResourceMaps struct {
RunningWlidsToContainerNames *maps.SafeMap[string, mapset.Set[string]]
RunningInstanceIds mapset.Set[string]
RunningContainerImageIds mapset.Set[string]
RunningTemplateHash 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 ¶
type ResourcesCleanupHandler struct {
// contains filtered or unexported fields
}
func NewResourcesCleanupHandler ¶
func NewResourcesCleanupHandler(appFs afero.Fs, root string, pool *sqlitemigration.Pool, watchDispatcher *file.WatchDispatcher, interval time.Duration, fetcher ResourcesFetcher, relevancyEnabled bool) *ResourcesCleanupHandler
func (*ResourcesCleanupHandler) StartCleanupTask ¶
func (h *ResourcesCleanupHandler) StartCleanupTask(ctx context.Context)
type ResourcesFetcher ¶
type ResourcesFetcher interface {
FetchResources() (ResourceMaps, error)
}
type TypeCleanupHandlerFunc ¶
type TypeCleanupHandlerFunc func(kind, path string, metadata *metav1.ObjectMeta, resourceMaps ResourceMaps) bool
type TypeDeleteFunc ¶ added in v0.0.89
Click to show internal directories.
Click to hide internal directories.