cluster

package
v0.0.13-rc11-z5nctl3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package cluster is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kubernetes

type Kubernetes struct {
	KubeConfig string
	Clientset  kubernetes.Interface
}

Kubernetes implements KubernetesInterface

func (*Kubernetes) ClusterCrids

func (k *Kubernetes) ClusterCrids(podCIDR string) (cidrs []string, err error)

ClusterCrids get cluster cirds

func (*Kubernetes) CreateService

func (k *Kubernetes) CreateService(name, namespace string, port int, labels map[string]string) (*v1.Service, error)

CreateService create kubernetes service

func (*Kubernetes) DecreaseRef

func (k *Kubernetes) DecreaseRef(namespace string, app string) (cleanup bool, err error)

DecreaseRef ...

func (*Kubernetes) Deployment

func (k *Kubernetes) Deployment(name, namespace string) (*appv1.Deployment, error)

Deployment get deployment

func (*Kubernetes) GetDeployment

func (k *Kubernetes) GetDeployment(name string, namespace string) (*appv1.Deployment, error)

GetDeployment ...

func (*Kubernetes) GetOrCreateShadow

func (k *Kubernetes) GetOrCreateShadow(name, namespace, image string, labels, envs map[string]string,
	debug bool, reuseShadow bool) (podIP, podName, sshcm string, credential *util.SSHCredential, err error)

GetOrCreateShadow create shadow

func (*Kubernetes) PortForward

func (k *Kubernetes) PortForward(namespace, resource string, remotePort int) (err error)

func (*Kubernetes) RemoveConfigMap

func (k *Kubernetes) RemoveConfigMap(name, namespace string) (err error)

RemoveConfigMap remove ConfigMap instance

func (*Kubernetes) RemoveDeployment

func (k *Kubernetes) RemoveDeployment(name, namespace string) (err error)

RemoveDeployment remove deployment instances

func (*Kubernetes) RemoveService

func (k *Kubernetes) RemoveService(name, namespace string) (err error)

RemoveService remove sevice

func (*Kubernetes) Scale

func (k *Kubernetes) Scale(deployment *appv1.Deployment, replicas *int32) (err error)

Scale scale deployment to

func (*Kubernetes) ScaleTo

func (k *Kubernetes) ScaleTo(deployment, namespace string, replicas *int32) (err error)

ScaleTo scale deployment to

func (*Kubernetes) ServiceHosts

func (k *Kubernetes) ServiceHosts(namespace string) (hosts map[string]string)

ServiceHosts get service dns map

func (*Kubernetes) UpdateDeployment

func (k *Kubernetes) UpdateDeployment(namespace string, deployment *appv1.Deployment) (*appv1.Deployment, error)

UpdateDeployment ...

type KubernetesInterface

type KubernetesInterface interface {
	RemoveDeployment(name, namespace string) (err error)
	RemoveConfigMap(name, namespace string) (err error)
	RemoveService(name, namespace string) (err error)
	Deployment(name, namespace string) (deployment *appV1.Deployment, err error)
	Scale(deployment *appV1.Deployment, replicas *int32) (err error)
	ScaleTo(deployment, namespace string, replicas *int32) (err error)
	ServiceHosts(namespace string) (hosts map[string]string)
	ClusterCrids(podCIDR string) (cidrs []string, err error)
	GetOrCreateShadow(name, namespace, image string, labels, envs map[string]string, debug, reuseShadow bool) (podIP, podName, sshcm string, credential *util.SSHCredential, err error)
	CreateService(name, namespace string, port int, labels map[string]string) (*coreV1.Service, error)
	GetDeployment(name string, namespace string) (*appV1.Deployment, error)
	UpdateDeployment(namespace string, deployment *appV1.Deployment) (*appV1.Deployment, error)
	DecreaseRef(namespace string, deployment string) (cleanup bool, err error)
	PortForward(namespace string, resource string, remotePort int) (err error)
}

KubernetesInterface kubernetes interface

func Create

func Create(kubeConfig string) (kubernetes KubernetesInterface, err error)

Create kubernetes instance

func CreateFromClientSet

func CreateFromClientSet(clientSet kubernetes.Interface) (kubernetes KubernetesInterface, err error)

CreateFromClientSet kubernetes instance

type MockKubernetesInterface

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

MockKubernetesInterface is a mock of KubernetesInterface interface

func NewMockKubernetesInterface

func NewMockKubernetesInterface(ctrl *gomock.Controller) *MockKubernetesInterface

NewMockKubernetesInterface creates a new mock instance

func (*MockKubernetesInterface) ClusterCrids

func (m *MockKubernetesInterface) ClusterCrids(podCIDR string) ([]string, error)

ClusterCrids mocks base method

func (*MockKubernetesInterface) CreateService

func (m *MockKubernetesInterface) CreateService(name, namespace string, port int, labels map[string]string) (*v10.Service, error)

CreateService mocks base method

func (*MockKubernetesInterface) DecreaseRef

func (m *MockKubernetesInterface) DecreaseRef(namespace, deployment string) (bool, error)

DecreaseRef mocks base method

func (*MockKubernetesInterface) Deployment

func (m *MockKubernetesInterface) Deployment(name, namespace string) (*v1.Deployment, error)

Deployment mocks base method

func (*MockKubernetesInterface) EXPECT

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

func (*MockKubernetesInterface) GetDeployment

func (m *MockKubernetesInterface) GetDeployment(name, namespace string) (*v1.Deployment, error)

GetDeployment mocks base method

func (*MockKubernetesInterface) GetOrCreateShadow

func (m *MockKubernetesInterface) GetOrCreateShadow(name, namespace, image string, labels, envs map[string]string, debug, reuseShadow bool) (string, string, string, *util.SSHCredential, error)

GetOrCreateShadow mocks base method

func (*MockKubernetesInterface) RemoveConfigMap

func (m *MockKubernetesInterface) RemoveConfigMap(name, namespace string) error

RemoveConfigMap mocks base method

func (*MockKubernetesInterface) RemoveDeployment

func (m *MockKubernetesInterface) RemoveDeployment(name, namespace string) error

RemoveDeployment mocks base method

func (*MockKubernetesInterface) RemoveService

func (m *MockKubernetesInterface) RemoveService(name, namespace string) error

RemoveService mocks base method

func (*MockKubernetesInterface) Scale

func (m *MockKubernetesInterface) Scale(deployment *v1.Deployment, replicas *int32) error

Scale mocks base method

func (*MockKubernetesInterface) ScaleTo

func (m *MockKubernetesInterface) ScaleTo(deployment, namespace string, replicas *int32) error

ScaleTo mocks base method

func (*MockKubernetesInterface) ServiceHosts

func (m *MockKubernetesInterface) ServiceHosts(namespace string) map[string]string

ServiceHosts mocks base method

func (*MockKubernetesInterface) UpdateDeployment

func (m *MockKubernetesInterface) UpdateDeployment(namespace string, deployment *v1.Deployment) (*v1.Deployment, error)

UpdateDeployment mocks base method

type MockKubernetesInterfaceMockRecorder

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

MockKubernetesInterfaceMockRecorder is the mock recorder for MockKubernetesInterface

func (*MockKubernetesInterfaceMockRecorder) ClusterCrids

func (mr *MockKubernetesInterfaceMockRecorder) ClusterCrids(podCIDR interface{}) *gomock.Call

ClusterCrids indicates an expected call of ClusterCrids

func (*MockKubernetesInterfaceMockRecorder) CreateService

func (mr *MockKubernetesInterfaceMockRecorder) CreateService(name, namespace, port, labels interface{}) *gomock.Call

CreateService indicates an expected call of CreateService

func (*MockKubernetesInterfaceMockRecorder) DecreaseRef

func (mr *MockKubernetesInterfaceMockRecorder) DecreaseRef(namespace, deployment interface{}) *gomock.Call

DecreaseRef indicates an expected call of DecreaseRef

func (*MockKubernetesInterfaceMockRecorder) Deployment

func (mr *MockKubernetesInterfaceMockRecorder) Deployment(name, namespace interface{}) *gomock.Call

Deployment indicates an expected call of Deployment

func (*MockKubernetesInterfaceMockRecorder) GetDeployment

func (mr *MockKubernetesInterfaceMockRecorder) GetDeployment(name, namespace interface{}) *gomock.Call

GetDeployment indicates an expected call of GetDeployment

func (*MockKubernetesInterfaceMockRecorder) GetOrCreateShadow

func (mr *MockKubernetesInterfaceMockRecorder) GetOrCreateShadow(name, namespace, image, labels, envs, debug, reuseShadow interface{}) *gomock.Call

GetOrCreateShadow indicates an expected call of GetOrCreateShadow

func (*MockKubernetesInterfaceMockRecorder) RemoveConfigMap

func (mr *MockKubernetesInterfaceMockRecorder) RemoveConfigMap(name, namespace interface{}) *gomock.Call

RemoveConfigMap indicates an expected call of RemoveConfigMap

func (*MockKubernetesInterfaceMockRecorder) RemoveDeployment

func (mr *MockKubernetesInterfaceMockRecorder) RemoveDeployment(name, namespace interface{}) *gomock.Call

RemoveDeployment indicates an expected call of RemoveDeployment

func (*MockKubernetesInterfaceMockRecorder) RemoveService

func (mr *MockKubernetesInterfaceMockRecorder) RemoveService(name, namespace interface{}) *gomock.Call

RemoveService indicates an expected call of RemoveService

func (*MockKubernetesInterfaceMockRecorder) Scale

func (mr *MockKubernetesInterfaceMockRecorder) Scale(deployment, replicas interface{}) *gomock.Call

Scale indicates an expected call of Scale

func (*MockKubernetesInterfaceMockRecorder) ScaleTo

func (mr *MockKubernetesInterfaceMockRecorder) ScaleTo(deployment, namespace, replicas interface{}) *gomock.Call

ScaleTo indicates an expected call of ScaleTo

func (*MockKubernetesInterfaceMockRecorder) ServiceHosts

func (mr *MockKubernetesInterfaceMockRecorder) ServiceHosts(namespace interface{}) *gomock.Call

ServiceHosts indicates an expected call of ServiceHosts

func (*MockKubernetesInterfaceMockRecorder) UpdateDeployment

func (mr *MockKubernetesInterfaceMockRecorder) UpdateDeployment(namespace, deployment interface{}) *gomock.Call

UpdateDeployment indicates an expected call of UpdateDeployment

type PodMetaAndSpec

type PodMetaAndSpec struct {
	Meta  *ResourceMeta
	Image string
	Envs  map[string]string
}

PodMetaAndSpec

type ResourceMeta

type ResourceMeta struct {
	Name      string
	Namespace string
	Labels    map[string]string
}

ResourceMeta ...

type SSHkeyMeta

type SSHkeyMeta struct {
	Sshcm          string
	PrivateKeyPath string
}

SSHkeyMeta ...

Jump to

Keyboard shortcuts

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