clusterscollector

package
v0.0.0-...-a4b4531 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterAPI

type ClusterAPI interface {
	ListClusters(project string) ([]*container.Cluster, error)
	RemoveCluster(project, zone, name string) error
}

ClusterAPI abstracts access to Cluster Container API in GCP

type ClusterAPIWrapper

type ClusterAPIWrapper struct {
	Context context.Context
	Service *container.ProjectsLocationsClustersService
}

ClusterAPIWrapper abstracts GCP ProjectsLocationsClustersService API

func (*ClusterAPIWrapper) ListClusters

func (caw *ClusterAPIWrapper) ListClusters(project string) ([]*container.Cluster, error)

ListClusters delegates to ProjectsLocationsClustersService.List(parent) function

func (*ClusterAPIWrapper) RemoveCluster

func (caw *ClusterAPIWrapper) RemoveCluster(project, zone, name string) error

RemoveCluster delegates to ProjectsLocationsClustersService.Delete(name) function

type ClusterRemovalPredicate

type ClusterRemovalPredicate func(cluster *container.Cluster) (bool, error)

ClusterRemovalPredicate returns true when the cluster should be deleted (matches removal criteria)

func TimeBasedClusterRemovalPredicate

func TimeBasedClusterRemovalPredicate(excludedClusters map[string]struct{}) ClusterRemovalPredicate

TimeBasedClusterRemovalPredicate returns an instance of ClusterRemovalPredicate that filters clusters based on label "volatile", "created-at", "ttl" and status

type ClustersGarbageCollector

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

ClustersGarbageCollector can find and delete clusters provisioned by gke-integration prow jobs and not cleaned up properly.

func NewClustersGarbageCollector

func NewClustersGarbageCollector(clusterAPI ClusterAPI, shouldRemove ClusterRemovalPredicate) *ClustersGarbageCollector

NewClustersGarbageCollector returns a new instance of ClustersksGarbageCollector

func (*ClustersGarbageCollector) Run

func (gc *ClustersGarbageCollector) Run(project string, makeChanges bool) (allSucceeded bool, err error)

Run executes garbage collection process for clusters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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