Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskAPI ¶
type DiskAPI interface { ListDisks(project, zone string) ([]*compute.Disk, error) RemoveDisk(name, project, zone string) error }
DiskAPI allows to access Disks Compute API in GCP
type DiskAPIWrapper ¶
type DiskAPIWrapper struct { Context context.Context Service *compute.DisksService }
DiskAPIWrapper abstracts GCP DisksService API
func (*DiskAPIWrapper) ListDisks ¶
func (daw *DiskAPIWrapper) ListDisks(project, zone string) ([]*compute.Disk, error)
ListDisks implements DiskAPI.ListDisks function
func (*DiskAPIWrapper) RemoveDisk ¶
func (daw *DiskAPIWrapper) RemoveDisk(project, zone, name string) error
RemoveDisk implements DiskAPI.RemoveDisk function
type DiskRemovalPredicate ¶
DiskRemovalPredicate returns true when disk should be deleted (matches removal criteria)
func NewDiskFilter ¶
func NewDiskFilter(diskNameRegexp *regexp.Regexp, ageInHours int) DiskRemovalPredicate
NewDiskFilter is a default DiskRemovalPredicate factory Disk is matching the criteria if it's: - Name matches diskNameRegexp - CreationTimestamp indicates that it is created more than ageInHours ago. - Users list is empty
type DisksGarbageCollector ¶
type DisksGarbageCollector struct {
// contains filtered or unexported fields
}
DisksGarbageCollector can find and delete disks provisioned by gke-integration prow jobs and not cleaned up properly.
func NewDisksGarbageCollector ¶
func NewDisksGarbageCollector(zoneAPI ZoneAPI, diskAPI DiskAPI, shouldRemove DiskRemovalPredicate) *DisksGarbageCollector
NewDisksGarbageCollector returns a new instance of DisksGarbageCollector
type ZoneAPIWrapper ¶
type ZoneAPIWrapper struct { Context context.Context Service *compute.ZonesService }
ZoneAPIWrapper abstracts GCP ZonesService API