fake

package
v0.35.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 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

func NewInstanceTypeWithCustomRequirement added in v0.35.0

func NewInstanceTypeWithCustomRequirement(options InstanceTypeOptions, customReq *scheduling.Requirement) *cloudprovider.InstanceType

func PriceFromResources added in v0.34.0

func PriceFromResources(resources v1.ResourceList) float64

Types

type CloudProvider

type CloudProvider struct {
	InstanceTypes            []*cloudprovider.InstanceType
	InstanceTypesForNodePool map[string][]*cloudprovider.InstanceType
	ErrorsForNodePool        map[string]error

	// CreateCalls contains the arguments for every create call that was made since it was cleared
	CreateCalls        []*v1beta1.NodeClaim
	AllowedCreateCalls int
	NextCreateErr      error
	DeleteCalls        []*v1beta1.NodeClaim

	CreatedNodeClaims map[string]*v1beta1.NodeClaim
	Drifted           cloudprovider.DriftReason
	// contains filtered or unexported fields
}

func NewCloudProvider

func NewCloudProvider() *CloudProvider

func (*CloudProvider) Create

func (c *CloudProvider) Create(ctx context.Context, nodeClaim *v1beta1.NodeClaim) (*v1beta1.NodeClaim, error)

func (*CloudProvider) Delete

func (c *CloudProvider) Delete(_ context.Context, nc *v1beta1.NodeClaim) error

func (*CloudProvider) Get

func (*CloudProvider) GetInstanceTypes

func (c *CloudProvider) GetInstanceTypes(_ context.Context, np *v1beta1.NodePool) ([]*cloudprovider.InstanceType, error)

func (*CloudProvider) IsDrifted

func (*CloudProvider) List

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 sets.Set[string]
	Resources        v1.ResourceList
}

Jump to

Keyboard shortcuts

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