fake

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0, Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Code generated by MockGen. DO NOT EDIT. Source: pkg/providers/instance/azure_client.go

Generated by this command:

mockgen -source=pkg/providers/instance/azure_client.go -destination=pkg/fake/azure_client.go

Index

Constants

View Source
const (
	LabelInstanceSize                       = "size"
	ExoticInstanceLabelKey                  = "special"
	IntegerInstanceLabelKey                 = "integer"
	ResourceGPUVendorA      v1.ResourceName = "fake.com/vendor-a"
	ResourceGPUVendorB      v1.ResourceName = "fake.com/vendor-b"
)

Variables

View Source
var ResourceSkus = []compute.ResourceSku{
	{
		Name:         lo.ToPtr("Standard_D2s_v3"),
		Tier:         lo.ToPtr("Standard"),
		Kind:         lo.ToPtr(""),
		Size:         lo.ToPtr("D2s_v3"),
		Family:       lo.ToPtr("standardDSv3Family"),
		ResourceType: lo.ToPtr("virtualMachines"),
		APIVersions:  &[]string{},
		Costs:        &[]compute.ResourceSkuCosts{},
		Restrictions: &[]compute.ResourceSkuRestrictions{},
		Capabilities: &[]compute.ResourceSkuCapabilities{
			{Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("16384")},
			{Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")},
			{Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")},
			{Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")},
			{Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")},
			{Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")},
			{Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")},
			{Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")},
			{Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("4000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("33554432")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("33554432")},
			{Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("53687091200")},
			{Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3200")},
			{Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("50331648")},
			{Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")},
		},
		Locations: &[]string{""},
		LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{
			"3",
			"2",
			"1",
		},
		},
		},
	},
	{
		Name:         lo.ToPtr("Standard_D2_v2"),
		Tier:         lo.ToPtr("Standard"),
		Kind:         lo.ToPtr(""),
		Size:         lo.ToPtr("D2_v2"),
		Family:       lo.ToPtr("standardDv2Family"),
		ResourceType: lo.ToPtr("virtualMachines"),
		APIVersions:  &[]string{},
		Costs:        &[]compute.ResourceSkuCosts{},
		Restrictions: &[]compute.ResourceSkuRestrictions{},
		Capabilities: &[]compute.ResourceSkuCapabilities{
			{Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("102400")},
			{Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")},
			{Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1")},
			{Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("7")},
			{Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")},
			{Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")},
			{Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS,PaaS")},
			{Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("210")},
			{Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("6000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("97517568")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("48234496")},
			{Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")},
		},
		Locations: &[]string{""},
		LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{
			"3",
			"2",
			"1",
		},
		},
		},
	},
	{
		Name:         lo.ToPtr("Standard_D2_v3"),
		Tier:         lo.ToPtr("Standard"),
		Kind:         lo.ToPtr(""),
		Size:         lo.ToPtr("D2_v3"),
		Family:       lo.ToPtr("standardDv3Family"),
		ResourceType: lo.ToPtr("virtualMachines"),
		APIVersions:  &[]string{},
		Costs:        &[]compute.ResourceSkuCosts{},
		Restrictions: &[]compute.ResourceSkuRestrictions{},
		Capabilities: &[]compute.ResourceSkuCapabilities{
			{Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("51200")},
			{Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")},
			{Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1")},
			{Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")},
			{Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")},
			{Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")},
			{Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS,PaaS")},
			{Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("160")},
			{Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("3000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("48234496")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("24117248")},
			{Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")},
		},
		Locations: &[]string{""},
		LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{
			"3",
			"2",
			"1",
		},
		},
		},
	},
	{
		Name:         lo.ToPtr("Standard_D2_v5"),
		Tier:         lo.ToPtr("Standard"),
		Kind:         lo.ToPtr(""),
		Size:         lo.ToPtr("D2_v5"),
		Family:       lo.ToPtr("standardDv5Family"),
		ResourceType: lo.ToPtr("virtualMachines"),
		APIVersions:  &[]string{},
		Costs:        &[]compute.ResourceSkuCosts{},
		Restrictions: &[]compute.ResourceSkuRestrictions{},
		Capabilities: &[]compute.ResourceSkuCapabilities{
			{Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("0")},
			{Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")},
			{Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")},
			{Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("8")},
			{Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("4")},
			{Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")},
			{Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")},
			{Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("19000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("131072000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("131072000")},
			{Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("3750")},
			{Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("89128960")},
			{Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")},
		},
		Locations: &[]string{""},
		LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{
			"3",
			"1",
			"2",
		},
		},
		},
	},
	{
		Name:         lo.ToPtr("Standard_DS2_v2"),
		Tier:         lo.ToPtr("Standard"),
		Kind:         lo.ToPtr(""),
		Size:         lo.ToPtr("DS2_v2"),
		Family:       lo.ToPtr("standardDSv2Family"),
		ResourceType: lo.ToPtr("virtualMachines"),
		APIVersions:  &[]string{},
		Costs:        &[]compute.ResourceSkuCosts{},
		Restrictions: &[]compute.ResourceSkuRestrictions{},
		Capabilities: &[]compute.ResourceSkuCapabilities{
			{Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("14336")},
			{Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")},
			{Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")},
			{Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("7")},
			{Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")},
			{Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")},
			{Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")},
			{Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("210")},
			{Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("8000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("65536000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("65536000")},
			{Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("92341796864")},
			{Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("6400")},
			{Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("96000000")},
			{Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")},
		},
		Locations: &[]string{""},
		LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{
			"3",
			"2",
			"1",
		},
		},
		},
	},
	{
		Name:         lo.ToPtr("Standard_F16s_v2"),
		Tier:         lo.ToPtr("Standard"),
		Kind:         lo.ToPtr(""),
		Size:         lo.ToPtr("F16s_v2"),
		Family:       lo.ToPtr("standardFSv2Family"),
		ResourceType: lo.ToPtr("virtualMachines"),
		APIVersions:  &[]string{},
		Costs:        &[]compute.ResourceSkuCosts{},
		Restrictions: &[]compute.ResourceSkuRestrictions{},
		Capabilities: &[]compute.ResourceSkuCapabilities{
			{Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("131072")},
			{Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")},
			{Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("16")},
			{Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V1,V2")},
			{Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("32")},
			{Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("32")},
			{Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")},
			{Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")},
			{Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("16")},
			{Name: lo.ToPtr("ACUs"), Value: lo.ToPtr("195")},
			{Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("2")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("32000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("262144000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("262144000")},
			{Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("274877906944")},
			{Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("25600")},
			{Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("384000000")},
			{Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("4")},
		},
		Locations: &[]string{""},
		LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{
			"3",
			"1",
			"2",
		},
		},
		},
	},
	{
		Name:         lo.ToPtr("Standard_NC24ads_A100_v4"),
		Tier:         lo.ToPtr("Standard"),
		Kind:         lo.ToPtr(""),
		Size:         lo.ToPtr("NC24ads_A100_v4"),
		Family:       lo.ToPtr("StandardNCADSA100v4Family"),
		ResourceType: lo.ToPtr("virtualMachines"),
		APIVersions:  &[]string{},
		Costs:        &[]compute.ResourceSkuCosts{},
		Restrictions: &[]compute.ResourceSkuRestrictions{},
		Capabilities: &[]compute.ResourceSkuCapabilities{
			{Name: lo.ToPtr("MaxResourceVolumeMB"), Value: lo.ToPtr("65536")},
			{Name: lo.ToPtr("OSVhdSizeMB"), Value: lo.ToPtr("1047552")},
			{Name: lo.ToPtr("vCPUs"), Value: lo.ToPtr("24")},
			{Name: lo.ToPtr("MemoryPreservingMaintenanceSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("HyperVGenerations"), Value: lo.ToPtr("V2")},
			{Name: lo.ToPtr("MemoryGB"), Value: lo.ToPtr("220")},
			{Name: lo.ToPtr("MaxDataDiskCount"), Value: lo.ToPtr("8")},
			{Name: lo.ToPtr("CpuArchitectureType"), Value: lo.ToPtr("x64")},
			{Name: lo.ToPtr("LowPriorityCapable"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("PremiumIO"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("VMDeploymentTypes"), Value: lo.ToPtr("IaaS")},
			{Name: lo.ToPtr("vCPUsAvailable"), Value: lo.ToPtr("24")},
			{Name: lo.ToPtr("GPUs"), Value: lo.ToPtr("1")},
			{Name: lo.ToPtr("vCPUsPerCore"), Value: lo.ToPtr("1")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedIOPS"), Value: lo.ToPtr("75000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedReadBytesPerSecond"), Value: lo.ToPtr("1000000000")},
			{Name: lo.ToPtr("CombinedTempDiskAndCachedWriteBytesPerSecond"), Value: lo.ToPtr("1000000000")},
			{Name: lo.ToPtr("CachedDiskBytes"), Value: lo.ToPtr("274877906944")},
			{Name: lo.ToPtr("UncachedDiskIOPS"), Value: lo.ToPtr("25600")},
			{Name: lo.ToPtr("UncachedDiskBytesPerSecond"), Value: lo.ToPtr("384000000")},
			{Name: lo.ToPtr("NvmeDiskSizeInMiB"), Value: lo.ToPtr("915456")},
			{Name: lo.ToPtr("EphemeralOSDiskSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("EncryptionAtHostSupported"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("CapacityReservationSupported"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("AcceleratedNetworkingEnabled"), Value: lo.ToPtr("True")},
			{Name: lo.ToPtr("RdmaEnabled"), Value: lo.ToPtr("False")},
			{Name: lo.ToPtr("MaxNetworkInterfaces"), Value: lo.ToPtr("2")},
		},
		Locations: &[]string{""},
		LocationInfo: &[]compute.ResourceSkuLocationInfo{{Location: lo.ToPtr(""), Zones: &[]string{
			"3",
		},
		},
		},
	},
}

ResourceSkus is a list of all available skus from azure

Functions

func InstanceTypes added in v0.2.0

func InstanceTypes(total int) []*cloudprovider.InstanceType

InstanceTypes creates instance types with incrementing resources 2Gi of RAM and 10 pods for every 1vcpu i.e. 1vcpu, 2Gi mem, 10 pods

2vcpu, 4Gi mem, 20 pods
3vcpu, 6Gi mem, 30 pods

func InstanceTypesAssorted added in v0.2.0

func InstanceTypesAssorted() []*cloudprovider.InstanceType

InstanceTypesAssorted create many unique instance types with varying CPU/memory/architecture/OS/zone/capacity type.

func NewInstanceType added in v0.2.0

func NewInstanceType(options InstanceTypeOptions) *cloudprovider.InstanceType

func NewProductPrice

func NewProductPrice(instanceType string, price float64) client.Item

Types

type AtomicError

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

func (*AtomicError) Get

func (e *AtomicError) Get() error

Get is equivalent to the error being called, so we increase number of calls in this function

func (*AtomicError) IsNil

func (e *AtomicError) IsNil() bool

func (*AtomicError) Reset

func (e *AtomicError) Reset()

func (*AtomicError) Set

func (e *AtomicError) Set(err error, opts ...AtomicErrorOption)

type AtomicErrorOption

type AtomicErrorOption func(atomicError *AtomicError)

func MaxCalls

func MaxCalls(maxCalls int) AtomicErrorOption

type AtomicPtr

type AtomicPtr[T any] struct {
	// contains filtered or unexported fields
}

AtomicPtr is intended for use in mocks to easily expose variables for use in testing. It makes setting and retrieving the values race free by wrapping the pointer itself in a mutex. There is no Get() method, but instead a Clone() method deep copies the object being stored by serializing/de-serializing it from JSON. This pattern shouldn't be followed anywhere else but is an easy way to eliminate races in our tests. nolint: structcheck

func (*AtomicPtr[T]) Clone

func (a *AtomicPtr[T]) Clone() *T

func (*AtomicPtr[T]) IsNil

func (a *AtomicPtr[T]) IsNil() bool

func (*AtomicPtr[T]) Reset

func (a *AtomicPtr[T]) Reset()

func (*AtomicPtr[T]) Set

func (a *AtomicPtr[T]) Set(v *T)

type AtomicPtrStack

type AtomicPtrStack[T any] struct {
	// contains filtered or unexported fields
}

AtomicPtrStack exposes a slice of a pointer type in a race-free manner. The interface is just enough to replace the set.Set usage in our previous tests. nolint: structcheck

func (*AtomicPtrStack[T]) Add

func (a *AtomicPtrStack[T]) Add(input *T)

func (*AtomicPtrStack[T]) Len

func (a *AtomicPtrStack[T]) Len() int

func (*AtomicPtrStack[T]) Pop

func (a *AtomicPtrStack[T]) Pop() *T

func (*AtomicPtrStack[T]) Reset

func (a *AtomicPtrStack[T]) Reset()

type CloudProvider added in v0.2.0

type CloudProvider struct {
	InstanceTypes []*cloudprovider.InstanceType

	// CreateCalls contains the arguments for every create call that was made since it was cleared
	CreateCalls        []*v1alpha5.Machine
	CreatedMachines    map[string]*v1alpha5.Machine
	DeleteCalls        []*v1alpha5.Machine
	Drifted            bool
	AllowedCreateCalls int
	// contains filtered or unexported fields
}

func NewCloudProvider added in v0.2.0

func NewCloudProvider() *CloudProvider

func (*CloudProvider) Create added in v0.2.0

func (c *CloudProvider) Create(ctx context.Context, machine *v1alpha5.Machine) (*v1alpha5.Machine, error)

func (*CloudProvider) Delete added in v0.2.0

func (*CloudProvider) Get added in v0.2.0

func (*CloudProvider) GetInstanceTypes added in v0.2.0

func (*CloudProvider) IsMachineDrifted added in v0.2.0

func (c *CloudProvider) IsMachineDrifted(context.Context, *v1alpha5.Machine) (bool, error)

func (*CloudProvider) List added in v0.2.0

func (*CloudProvider) Name added in v0.2.0

func (c *CloudProvider) Name() string

Name returns the CloudProvider implementation name.

func (*CloudProvider) Reset added in v0.2.0

func (c *CloudProvider) Reset()

Reset is for BeforeEach calls in testing to reset the tracking of CreateCalls

type InstanceTypeOptions added in v0.2.0

type InstanceTypeOptions struct {
	Name             string
	Offerings        cloudprovider.Offerings
	Architecture     string
	OperatingSystems utilsets.String
	Resources        v1.ResourceList
}

type MockAgentPoolsAPI added in v0.2.0

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

MockAgentPoolsAPI is a mock of AgentPoolsAPI interface.

func NewMockAgentPoolsAPI added in v0.2.0

func NewMockAgentPoolsAPI(ctrl *gomock.Controller) *MockAgentPoolsAPI

NewMockAgentPoolsAPI creates a new mock instance.

func (*MockAgentPoolsAPI) BeginCreateOrUpdate added in v0.2.0

func (m *MockAgentPoolsAPI) BeginCreateOrUpdate(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, parameters v4.AgentPool, options *v4.AgentPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[v4.AgentPoolsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate mocks base method.

func (*MockAgentPoolsAPI) BeginDelete added in v0.2.0

func (m *MockAgentPoolsAPI) BeginDelete(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, options *v4.AgentPoolsClientBeginDeleteOptions) (*runtime.Poller[v4.AgentPoolsClientDeleteResponse], error)

BeginDelete mocks base method.

func (*MockAgentPoolsAPI) EXPECT added in v0.2.0

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

func (*MockAgentPoolsAPI) Get added in v0.2.0

func (m *MockAgentPoolsAPI) Get(ctx context.Context, resourceGroupName, resourceName, agentPoolName string, options *v4.AgentPoolsClientGetOptions) (v4.AgentPoolsClientGetResponse, error)

Get mocks base method.

func (*MockAgentPoolsAPI) NewListPager added in v0.2.0

func (m *MockAgentPoolsAPI) NewListPager(resourceGroupName, resourceName string, options *v4.AgentPoolsClientListOptions) *runtime.Pager[v4.AgentPoolsClientListResponse]

NewListPager mocks base method.

type MockAgentPoolsAPIMockRecorder added in v0.2.0

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

MockAgentPoolsAPIMockRecorder is the mock recorder for MockAgentPoolsAPI.

func (*MockAgentPoolsAPIMockRecorder) BeginCreateOrUpdate added in v0.2.0

func (mr *MockAgentPoolsAPIMockRecorder) BeginCreateOrUpdate(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options any) *gomock.Call

BeginCreateOrUpdate indicates an expected call of BeginCreateOrUpdate.

func (*MockAgentPoolsAPIMockRecorder) BeginDelete added in v0.2.0

func (mr *MockAgentPoolsAPIMockRecorder) BeginDelete(ctx, resourceGroupName, resourceName, agentPoolName, options any) *gomock.Call

BeginDelete indicates an expected call of BeginDelete.

func (*MockAgentPoolsAPIMockRecorder) Get added in v0.2.0

func (mr *MockAgentPoolsAPIMockRecorder) Get(ctx, resourceGroupName, resourceName, agentPoolName, options any) *gomock.Call

Get indicates an expected call of Get.

func (*MockAgentPoolsAPIMockRecorder) NewListPager added in v0.2.0

func (mr *MockAgentPoolsAPIMockRecorder) NewListPager(resourceGroupName, resourceName, options any) *gomock.Call

NewListPager indicates an expected call of NewListPager.

type MockClient added in v0.2.0

type MockClient struct {
	mock.Mock

	ObjectMap  map[reflect.Type]map[k8sClient.ObjectKey]k8sClient.Object
	StatusMock *MockStatusClient
	UpdateCb   func(key types.NamespacedName)
}

MockClient is a mock for the controller-runtime dynamic client interface.

func NewClient added in v0.2.0

func NewClient() *MockClient

func (*MockClient) Create added in v0.2.0

func (m *MockClient) Create(ctx context.Context, obj k8sClient.Object, opts ...k8sClient.CreateOption) error

func (*MockClient) CreateMapWithType added in v0.2.0

func (m *MockClient) CreateMapWithType(t interface{}) map[k8sClient.ObjectKey]k8sClient.Object

func (*MockClient) CreateOrUpdateObjectInMap added in v0.2.0

func (m *MockClient) CreateOrUpdateObjectInMap(obj k8sClient.Object)

func (*MockClient) Delete added in v0.2.0

func (m *MockClient) Delete(ctx context.Context, obj k8sClient.Object, opts ...k8sClient.DeleteOption) error

func (*MockClient) DeleteAllOf added in v0.2.0

func (m *MockClient) DeleteAllOf(ctx context.Context, obj k8sClient.Object, opts ...k8sClient.DeleteAllOfOption) error

func (*MockClient) Get added in v0.2.0

k8s Client interface

func (*MockClient) GetObjectFromMap added in v0.2.0

func (m *MockClient) GetObjectFromMap(obj k8sClient.Object, key types.NamespacedName)

func (*MockClient) GroupVersionKindFor added in v0.2.0

func (m *MockClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)

GroupVersionKindFor implements client.Client

func (*MockClient) IsObjectNamespaced added in v0.2.0

func (m *MockClient) IsObjectNamespaced(obj runtime.Object) (bool, error)

IsObjectNamespaced implements client.Client

func (*MockClient) List added in v0.2.0

func (*MockClient) Patch added in v0.2.0

func (m *MockClient) Patch(ctx context.Context, obj k8sClient.Object, patch k8sClient.Patch, opts ...k8sClient.PatchOption) error

func (*MockClient) RESTMapper added in v0.2.0

func (m *MockClient) RESTMapper() meta.RESTMapper

func (*MockClient) Scheme added in v0.2.0

func (m *MockClient) Scheme() *runtime.Scheme

func (*MockClient) Status added in v0.2.0

func (m *MockClient) Status() k8sClient.StatusWriter

func (*MockClient) Update added in v0.2.0

func (m *MockClient) Update(ctx context.Context, obj k8sClient.Object, opts ...k8sClient.UpdateOption) error

type MockHandler

type MockHandler[T any] struct {
	// contains filtered or unexported fields
}

MockHandler returns a pre-defined result or error. nolint: structcheck

func (MockHandler[T]) Done

func (h MockHandler[T]) Done() bool

Done returns true if the LRO has reached a terminal state. TrivialHanlder is always done.

func (MockHandler[T]) Poll

func (h MockHandler[T]) Poll(context.Context) (*http.Response, error)

Poll fetches the latest state of the LRO.

func (MockHandler[T]) Result

func (h MockHandler[T]) Result(_ context.Context, result *T) error

Result is called once the LRO has reached a terminal state. It populates the out parameter with the result of the operation.

type MockPollingHandler added in v0.2.0

type MockPollingHandler[T any] struct {
	// contains filtered or unexported fields
}

MockPollingHandler is a mock implementation of PollingHandler interface.

func NewMockPollingHandler added in v0.2.0

func NewMockPollingHandler[T any](ctrl *gomock.Controller) *MockPollingHandler[T]

NewMockPollingHandler creates a new mock instance.

func (*MockPollingHandler[T]) Done added in v0.2.0

func (m *MockPollingHandler[T]) Done() bool

Done mocks the Done method of the PollingHandler interface.

func (*MockPollingHandler[T]) EXPECT added in v0.2.0

EXPECT methods can be used to set up expected calls.

func (*MockPollingHandler[T]) Poll added in v0.2.0

func (m *MockPollingHandler[T]) Poll(ctx context.Context) (*http.Response, error)

Poll mocks the Poll method of the PollingHandler interface.

func (*MockPollingHandler[T]) Result added in v0.2.0

func (m *MockPollingHandler[T]) Result(ctx context.Context, out *T) error

Result mocks the Result method of the PollingHandler interface.

type MockPollingHandlerMockRecorder added in v0.2.0

type MockPollingHandlerMockRecorder[T any] struct {
	// contains filtered or unexported fields
}

MockPollingHandlerMockRecorder is the mock recorder for MockPollingHandler.

func (*MockPollingHandlerMockRecorder[T]) Done added in v0.2.0

func (*MockPollingHandlerMockRecorder[T]) Poll added in v0.2.0

func (mr *MockPollingHandlerMockRecorder[T]) Poll(ctx any) *gomock.Call

func (*MockPollingHandlerMockRecorder[T]) Result added in v0.2.0

func (mr *MockPollingHandlerMockRecorder[T]) Result(ctx, out any) *gomock.Call

type MockStatusClient added in v0.2.0

type MockStatusClient struct {
	mock.Mock
}

func (*MockStatusClient) Patch added in v0.2.0

Patch implements client.StatusWriter

func (*MockStatusClient) Update added in v0.2.0

Update implements client.StatusWriter

type MockedFunction

type MockedFunction[I any, O any] struct {
	Output          AtomicPtr[O]      // Output to return on call to this function
	CalledWithInput AtomicPtrStack[I] // Stack used to keep track of passed input to this function
	Error           AtomicError       // Error to return a certain number of times defined by custom error options
	// contains filtered or unexported fields
}

func (*MockedFunction[I, O]) Calls

func (m *MockedFunction[I, O]) Calls() int

func (*MockedFunction[I, O]) FailedCalls

func (m *MockedFunction[I, O]) FailedCalls() int

func (*MockedFunction[I, O]) Invoke

func (m *MockedFunction[I, O]) Invoke(input *I, defaultTransformer func(*I) (O, error)) (O, error)

func (*MockedFunction[I, O]) Reset

func (m *MockedFunction[I, O]) Reset()

Reset must be called between tests otherwise tests will pollute each other.

func (*MockedFunction[I, O]) SuccessfulCalls

func (m *MockedFunction[I, O]) SuccessfulCalls() int

type MockedLRO

type MockedLRO[I any, O any] struct {
	MockedFunction[I, O]
	BeginError AtomicError // Error to return a certain number of times defined by custom error options (for Begin)
}

func (*MockedLRO[I, O]) Calls

func (m *MockedLRO[I, O]) Calls() int

func (*MockedLRO[I, O]) FailedCalls

func (m *MockedLRO[I, O]) FailedCalls() int

func (*MockedLRO[I, O]) Invoke

func (m *MockedLRO[I, O]) Invoke(input *I, defaultTransformer func(*I) (*O, error)) (*runtime.Poller[O], error)

func (*MockedLRO[I, O]) Reset

func (m *MockedLRO[I, O]) Reset()

Reset must be called between tests otherwise tests will pollute each other.

func (*MockedLRO[I, O]) SuccessfulCalls

func (m *MockedLRO[I, O]) SuccessfulCalls() int

type PricingAPI

type PricingAPI struct {
	client.PricingAPI
	PricingBehavior
}

func (*PricingAPI) GetProductsPricePages

func (p *PricingAPI) GetProductsPricePages(_ context.Context, _ []*client.Filter, fn func(output *client.ProductsPricePage)) error

func (*PricingAPI) Reset

func (p *PricingAPI) Reset()

type PricingBehavior

type PricingBehavior struct {
	NextError         AtomicError
	ProductsPricePage AtomicPtr[client.ProductsPricePage]
}

type ResourceSKUsAPI

type ResourceSKUsAPI struct {
}

func (*ResourceSKUsAPI) ListComplete

func (*ResourceSKUsAPI) Reset

func (s *ResourceSKUsAPI) Reset()

Reset must be called between tests otherwise tests will pollute each other.

Jump to

Keyboard shortcuts

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