mock

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MockIP           = "1.1.1.1"
	MockCluster      = "mock-cluster"
	MockPrismCentral = "mock-pc"
	MockRegion       = "mock-region"
	MockZone         = "mock-zone"

	MockDefaultRegion = "region"
	MockDefaultZone   = "zone"

	MockVMNamePoweredOn                  = "mock-vm-poweredon"
	MockVMNamePoweredOff                 = "mock-vm-poweredoff"
	MockVMNameCategories                 = "mock-vm-categories"
	MockVMNameNoAddresses                = "mock-vm-no-addresses"
	MockVMNameFilteredNodeAddresses      = "mock-vm-filtered-node-addresses"
	MockVMNamePoweredOnClusterCategories = "mock-vm-poweredon-cluster-categories"

	MockNodeNameVMNotExisting = "mock-node-no-vm-exists"
	MockNodeNameNoSystemUUID  = "mock-node-no-system-uuid"
)

Variables

This section is empty.

Functions

func CheckAdditionalLabels

func CheckAdditionalLabels(node *v1.Node, vm *prismClientV3.VMIntentResponse)

func CreatePrismCentralCluster

func CreatePrismCentralCluster(clusterName string) *prismClientV3.ClusterIntentResponse

func GenerateMockConfig

func GenerateMockConfig() config.Config

func ValidateInstanceMetadata

func ValidateInstanceMetadata(metadata *cloudprovider.InstanceMetadata, vm *prismClientV3.VMIntentResponse, region, zone string)

Types

type MockClient

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

MockClient is a mock implementation of the interfaces.Client interface

func CreateMockClient

func CreateMockClient(mockEnvironment MockEnvironment) *MockClient

CreateMockClient creates a new MockClient

func (*MockClient) Get

func (mc *MockClient) Get() (interfaces.Prism, error)

Get returns the mockPrism

func (*MockClient) SetInformers

func (mc *MockClient) SetInformers(sharedInformers informers.SharedInformerFactory)

SetInformers sets the sharedInformers

type MockEnvironment

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

func CreateMockEnvironment

func CreateMockEnvironment(ctx context.Context, kClient *fake.Clientset) (*MockEnvironment, error)

func (*MockEnvironment) AddCluster

func (*MockEnvironment) DeleteCluster

func (m *MockEnvironment) DeleteCluster(clusterUUID string)

func (*MockEnvironment) GetCluster

func (m *MockEnvironment) GetCluster(ctx context.Context, clusterName string) *prismClientV3.ClusterIntentResponse

func (*MockEnvironment) GetNode

func (m *MockEnvironment) GetNode(nodeName string) *v1.Node

func (*MockEnvironment) GetVM

type MockPrism

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

func (*MockPrism) GetCluster

func (mp *MockPrism) GetCluster(ctx context.Context, clusterUUID string) (*prismClientV3.ClusterIntentResponse, error)

func (*MockPrism) GetVM

func (mp *MockPrism) GetVM(ctx context.Context, vmUUID string) (*prismClientV3.VMIntentResponse, error)

func (*MockPrism) ListAllCluster

func (mp *MockPrism) ListAllCluster(ctx context.Context, filter string) (*prismClientV3.ClusterListIntentResponse, error)

Jump to

Keyboard shortcuts

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