Documentation ¶
Overview ¶
Package mock implements mocks for important interfaces like the Hivelocity api.
Index ¶
Constants ¶
const DefaultCPUCores = 1
DefaultCPUCores defines the default cpu cores for Hivelocity machines' capacities.
const DefaultMemoryInGB = float32(4)
DefaultMemoryInGB defines the default memory in GB for Hivelocity machines' capacities.
const (
// FreeDeviceID is a deviceID which references a device which is not associated with a node.
FreeDeviceID = 1
)
const NoTagsDeviceID = 3
NoTagsDeviceID is a deviceID which references a device which has no tags.
const OtherClusterDeviceID = 2
OtherClusterDeviceID is a deviceID which references a device which is from an other cluster.
const WithPrimaryIPDeviceID = 4
WithPrimaryIPDeviceID is a deviceID which references a device which has a PrimaryIp.
Variables ¶
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.
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.
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.
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.
var NoTagsDevice = hv.BareMetalDevice{ Hostname: "host3-unused", Tags: []string{}, DeviceId: NoTagsDeviceID, PowerStatus: "ON", OsName: defaultImage, }
NoTagsDevice is a device which has no tags.
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.
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 ¶
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.