fake

package
v0.0.0-...-d7985ca Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

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

This section is empty.

Functions

func InstanceTypes

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

func InstanceTypesAssorted() []*cloudprovider.InstanceType

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

func NewInstanceType

func NewInstanceType(options InstanceTypeOptions) *cloudprovider.InstanceType

Types

type CloudProvider

type CloudProvider struct {
	InstanceTypes []*cloudprovider.InstanceType

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

func NewCloudProvider

func NewCloudProvider() *CloudProvider

func (*CloudProvider) Create

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

func (*CloudProvider) Delete

func (*CloudProvider) Get

func (*CloudProvider) GetInstanceTypes

func (*CloudProvider) IsMachineDrifted

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

func (*CloudProvider) Name

func (c *CloudProvider) Name() string

Name returns the CloudProvider implementation name.

func (*CloudProvider) Reset

func (c *CloudProvider) Reset()

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

type InstanceTypeOptions

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

Jump to

Keyboard shortcuts

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