cleaner

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LabelCleanupPodNoNeedReason is the label key used to describe the caches cleanup
	// pod no need reason
	LabelCleanupPodNoNeedReason = "pod.cyclone.dev/no-need-reason"

	// NoNeedReasonPVCDeleted ...
	NoNeedReasonPVCDeleted = "pvc-deleted"
)

Variables

This section is empty.

Functions

func InitCacheCleanupStatus

func InitCacheCleanupStatus(client k8s.Interface) error

InitCacheCleanupStatus should only be invoked when cyclone server startup, it will update all Running status of Cleanup to Failed

func StopReasonNoNeed

func StopReasonNoNeed(client kubernetes.Interface, namespace, reason string) error

StopReasonNoNeed deletes all cache cleaner pods under a namespace, since cleanup is no need. No need means cleanup status will be Succeeded instead of Failed. Scenarios no need may including:

  • The pvc is deleted by other components

Types

type Cleaner

type Cleaner struct {
	// contains filtered or unexported fields
}

Cleaner cleans acceleration caches of a project

func NewCleaner

func NewCleaner(clusterClient kubernetes.Interface, client clientset.Interface, projectNamespace, projectName string) *Cleaner

NewCleaner creates a new acceleration caches cleaner.

func (*Cleaner) Clean

func (c *Cleaner) Clean(pvcNamespace, pvcName string) (*v1alpha1.AccelerationCacheCleanupStatus, error)

Clean start a pod to do the clean work, and returns the pod name.

Jump to

Keyboard shortcuts

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