portrecycle

package
v0.0.0-...-9649b88 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultMaxCheckTime = 3
View Source
const DefaultRegularCheckInterval = 15 * time.Minute
View Source
const MinutesInADay = (24 * 60)

Variables

View Source
var MaxCheckTimes int

Functions

func ClearPodInDb

func ClearPodInDb(tenantID, ns, name string) error

func ClearPortInDb

func ClearPortInDb(ns, name string, port iaasaccessor.Interface) error

func ClearPortsOfNoUsedPod

func ClearPortsOfNoUsedPod(ns, name string) error

func CollectAndClear

func CollectAndClear()

func GetKeysOfAllPortsInPodDir

func GetKeysOfAllPortsInPodDir(ns, name string) ([]*client.Node, error)

func GetMaxCheckTimes

func GetMaxCheckTimes() int

func GetPortInfo

func GetPortInfo(ports []*client.Node) ([]iaasaccessor.Interface, error)

func GetPortsOfPod

func GetPortsOfPod(ns, name string) ([]iaasaccessor.Interface, error)

func GetRegularCheckInterval

func GetRegularCheckInterval() time.Duration

func RecyclePortSource

func RecyclePortSource(port iaasaccessor.Interface) error

func RecycleResourseByTimer

func RecycleResourseByTimer()

func RegularCollectAndClear

func RegularCollectAndClear()

Types

type Pod

type Pod struct {
	PodNs   string
	PodName string
}

func AnalyzePods

func AnalyzePods(pods []*jason.Object) []Pod

func CollectNoUsedPod

func CollectNoUsedPod() ([]Pod, error)

func CountAndCollectNoUsedPod

func CountAndCollectNoUsedPod() []Pod

func GetPodsFromDb

func GetPodsFromDb() ([]Pod, error)

func GetPodsFromK8s

func GetPodsFromK8s() ([]Pod, error)

func RemoveSliceCopy

func RemoveSliceCopy(slice []Pod, start, end int) []Pod

type PodList

type PodList struct {
	PodsList []Pod
}

type RecyclePodRepo

type RecyclePodRepo interface {
	Load() error
	memtbl.MemTblOp
	refcnt.RefCounter
}

func GetRecyclePodTableTableSingleton

func GetRecyclePodTableTableSingleton() RecyclePodRepo

type RecyclePodTableRole

type RecyclePodTableRole struct {
	PodMap map[string]interface{}
	// contains filtered or unexported fields
}

func (*RecyclePodTableRole) Dec

func (this *RecyclePodTableRole) Dec(key, refer string) error

func (*RecyclePodTableRole) Delete

func (this *RecyclePodTableRole) Delete(key string) error

func (*RecyclePodTableRole) Get

func (this *RecyclePodTableRole) Get(key string) (interface{}, error)

func (*RecyclePodTableRole) GetAll

func (this *RecyclePodTableRole) GetAll() (map[string]interface{}, error)

func (*RecyclePodTableRole) Inc

func (this *RecyclePodTableRole) Inc(key, mock string) error

func (*RecyclePodTableRole) Insert

func (this *RecyclePodTableRole) Insert(key string, value interface{}) error

func (*RecyclePodTableRole) IsEmpty

func (this *RecyclePodTableRole) IsEmpty(key string) bool

func (*RecyclePodTableRole) Load

func (this *RecyclePodTableRole) Load() error

type RecyclePodValue

type RecyclePodValue struct {
	//ContainerId string   `json:"container_id"`
	//NetNs   string       `json:"netns"`
	PodNs   string `json:"podns"`
	PodName string `json:"podname"`
	Count   int    `json:"count"`
}

Jump to

Keyboard shortcuts

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