thyella

package
v0.0.0-...-24774f1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package thyella is a generated GoMock package.

Package thyella is a generated GoMock package.

Index

Constants

View Source
const (
	EvictionKind        = "Eviction"
	EvictionSubresource = "pods/eviction"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GKEClient

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

GKEClient gke client

func NewGKEClient

func NewGKEClient(project string) (*GKEClient, error)

NewGKEClient returns initialized GKEClient

func (GKEClient) DeleteInstance

func (gke GKEClient) DeleteInstance(ctx context.Context, clusterName string, node *Node) error

DeleteInstance delete GCE instance.

func (GKEClient) GetNodePool

func (gke GKEClient) GetNodePool(ctx context.Context, clusterName, poolName string, nodes []*Node) (*NodePool, error)

GetNodePool returns node-pool

type K8sAccessor

type K8sAccessor interface {
	GetNodeList(ctx context.Context) ([]*Node, error)
	Purge(ctx context.Context, node *Node) error
}

K8sAccessor wrapped raw k8s client

func NewK8sClient

func NewK8sClient() (K8sAccessor, error)

NewK8sClient returns initialized K8sClient

type K8sClient

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

K8sClient k8s client

func (K8sClient) GetNodeList

func (k8s K8sClient) GetNodeList(ctx context.Context) ([]*Node, error)

GetNodeList returns the nodes owned by the cluster

func (K8sClient) Purge

func (k8s K8sClient) Purge(ctx context.Context, node *Node) error

Purge drain & delete.

type KaasProvider

type KaasProvider interface {
	GetNodePool(ctx context.Context, clusterName, poolName string, nodes []*Node) (*NodePool, error)
	DeleteInstance(ctx context.Context, clusterName string, node *Node) error
}

KaasProvider wrapped GKE client

type MockK8sAccessor

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

MockK8sAccessor is a mock of K8sAccessor interface

func NewMockK8sAccessor

func NewMockK8sAccessor(ctrl *gomock.Controller) *MockK8sAccessor

NewMockK8sAccessor creates a new mock instance

func (*MockK8sAccessor) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockK8sAccessor) GetNodeList

func (m *MockK8sAccessor) GetNodeList(ctx context.Context) ([]*Node, error)

GetNodeList mocks base method

func (*MockK8sAccessor) Purge

func (m *MockK8sAccessor) Purge(ctx context.Context, node *Node) error

Purge mocks base method

type MockK8sAccessorMockRecorder

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

MockK8sAccessorMockRecorder is the mock recorder for MockK8sAccessor

func (*MockK8sAccessorMockRecorder) GetNodeList

func (mr *MockK8sAccessorMockRecorder) GetNodeList(ctx interface{}) *gomock.Call

GetNodeList indicates an expected call of GetNodeList

func (*MockK8sAccessorMockRecorder) Purge

func (mr *MockK8sAccessorMockRecorder) Purge(ctx, node interface{}) *gomock.Call

Purge indicates an expected call of Purge

type MockKaasProvider

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

MockKaasProvider is a mock of KaasProvider interface

func NewMockKaasProvider

func NewMockKaasProvider(ctrl *gomock.Controller) *MockKaasProvider

NewMockKaasProvider creates a new mock instance

func (*MockKaasProvider) DeleteInstance

func (m *MockKaasProvider) DeleteInstance(ctx context.Context, clusterName string, node *Node) error

DeleteInstance mocks base method

func (*MockKaasProvider) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockKaasProvider) GetNodePool

func (m *MockKaasProvider) GetNodePool(ctx context.Context, clusterName, poolName string, nodes []*Node) (*NodePool, error)

GetNodePool mocks base method

type MockKaasProviderMockRecorder

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

MockKaasProviderMockRecorder is the mock recorder for MockKaasProvider

func (*MockKaasProviderMockRecorder) DeleteInstance

func (mr *MockKaasProviderMockRecorder) DeleteInstance(ctx, clusterName, node interface{}) *gomock.Call

DeleteInstance indicates an expected call of DeleteInstance

func (*MockKaasProviderMockRecorder) GetNodePool

func (mr *MockKaasProviderMockRecorder) GetNodePool(ctx, clusterName, poolName, nodes interface{}) *gomock.Call

GetNodePool indicates an expected call of GetNodePool

type Node

type Node struct {
	Name     string
	NodePool string
	Zone     string
	Age      time.Duration
	Ready    bool
}

Node represents node

type NodePool

type NodePool struct {
	Name         string
	Autoscale    bool
	MinNodeCount int
	Preemptible  bool
	Status       string
	ZoneURLs     []string
	Nodes        []*Node
}

NodePool represents node-pool

func (*NodePool) AllGreen

func (np *NodePool) AllGreen() bool

AllGreen returns available or not

func (*NodePool) GetMaxAgeNode

func (np *NodePool) GetMaxAgeNode() (*Node, bool)

GetMaxAgeNode returns max age node

func (*NodePool) GetMaxAgeNodeWithBalance

func (np *NodePool) GetMaxAgeNodeWithBalance() (*Node, bool)

GetMaxAgeNodeWithBalance returns the longest-lived node so that it is even for each zone.

func (*NodePool) IsMinimumNodes

func (np *NodePool) IsMinimumNodes() bool

IsMinimumNodes returns running nodes is minimum or not

type NodePoolGroup

type NodePoolGroup struct {
	NodePools []*NodePool
}

NodePoolGroup represents node-pool group e.g. preemptible pool and non-preemptible pool

func (NodePoolGroup) GetPoolWithPreemptible

func (npg NodePoolGroup) GetPoolWithPreemptible(preemptible bool) (*NodePool, bool)

GetPoolWithPreemptible returns node pool specified preemptible status

func (NodePoolGroup) String

func (npg NodePoolGroup) String() string

type Thyella

type Thyella struct {
	KaasClient KaasProvider
	K8sClient  K8sAccessor
}

Thyella provide purge

func (Thyella) Purge

func (p Thyella) Purge(cluster string, nps []string) error

Purge purge nodes.

Jump to

Keyboard shortcuts

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