mock

package
v1.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mock implements mocks for important interfaces like the Hivelocity api.

Index

Constants

View Source
const DefaultCPUCores = 1

DefaultCPUCores defines the default cpu cores for Hivelocity machines' capacities.

View Source
const DefaultMemoryInGB = float32(4)

DefaultMemoryInGB defines the default memory in GB for Hivelocity machines' capacities.

View Source
const (
	// FreeDeviceID is a deviceID which references a device which is not associated with a node.
	FreeDeviceID = 1
)
View Source
const NoTagsDeviceID = 3

NoTagsDeviceID is a deviceID which references a device which has no tags.

View Source
const OtherClusterDeviceID = 2

OtherClusterDeviceID is a deviceID which references a device which is from an other cluster.

View Source
const WithPrimaryIPDeviceID = 4

WithPrimaryIPDeviceID is a deviceID which references a device which has a PrimaryIp.

Variables

View Source
var FreeDevice = hv.BareMetalDevice{
	Hostname:    "host-FreeDevice",
	Tags:        []string{hvtag.DeviceTag{Key: hvtag.DeviceTagKeyDeviceType, Value: "hvCustom"}.ToString()},
	DeviceId:    FreeDeviceID,
	PowerStatus: "ON",
	OsName:      defaultImage,
}

FreeDevice is a device which is not associated with a node.

View Source
var FreeDevicePool1 = hv.BareMetalDevice{
	Hostname:    "host-FreeDevice",
	Tags:        []string{hvtag.DeviceTag{Key: hvtag.DeviceTagKeyDeviceType, Value: "pool"}.ToString()},
	DeviceId:    51,
	PowerStatus: "ON",
	OsName:      defaultImage,
}

FreeDevicePool1 is a device which is not associated with a node.

View Source
var FreeDevicePool2 = hv.BareMetalDevice{
	Hostname:    "host-FreeDevice",
	Tags:        []string{hvtag.DeviceTag{Key: hvtag.DeviceTagKeyDeviceType, Value: "pool"}.ToString()},
	DeviceId:    52,
	PowerStatus: "ON",
	OsName:      defaultImage,
}

FreeDevicePool2 is a device which is not associated with a node.

View Source
var FreeDevicePool3 = hv.BareMetalDevice{
	Hostname:    "host-FreeDevice",
	Tags:        []string{hvtag.DeviceTag{Key: hvtag.DeviceTagKeyDeviceType, Value: "pool"}.ToString()},
	DeviceId:    53,
	PowerStatus: "ON",
	OsName:      defaultImage,
}

FreeDevicePool3 is a device which is not associated with a node.

View Source
var NoTagsDevice = hv.BareMetalDevice{
	Hostname:    "host3-unused",
	Tags:        []string{},
	DeviceId:    NoTagsDeviceID,
	PowerStatus: "ON",
	OsName:      defaultImage,
}

NoTagsDevice is a device which has no tags.

View Source
var OtherClusterDevice = hv.BareMetalDevice{
	Hostname: "host2-OtherClusterDevice",
	Tags: []string{
		hvtag.DeviceTag{Key: hvtag.DeviceTagKeyCluster, Value: "other-cluster"}.ToString(),
	},
	DeviceId:    OtherClusterDeviceID,
	PowerStatus: "ON",
	OsName:      defaultImage,
}

OtherClusterDevice is a device which is from an other cluster.

View Source
var WithPrimaryIPDevice = hv.BareMetalDevice{
	Hostname:    "host4-with-ip",
	Tags:        []string{},
	DeviceId:    WithPrimaryIPDeviceID,
	PowerStatus: "ON",
	OsName:      defaultImage,
	PrimaryIp:   "127.0.0,1",
}

WithPrimaryIPDevice is a device which has a PrimaryIp.

Functions

func NewMockedHVClientFactory

func NewMockedHVClientFactory() hvclient.Factory

NewMockedHVClientFactory creates new mock Hivelocity client factories using the in memory store. We re-use the client, so that changes done in Reconcile() are visible in the tests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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