Documentation ¶
Index ¶
- Constants
- func InstanceTypes(total int) []*cloudprovider.InstanceType
- func InstanceTypesAssorted() []*cloudprovider.InstanceType
- func NewInstanceType(options InstanceTypeOptions) *cloudprovider.InstanceType
- type CloudProvider
- func (c *CloudProvider) Create(ctx context.Context, machine *v1alpha5.Machine) (*v1alpha5.Machine, error)
- func (c *CloudProvider) Delete(_ context.Context, m *v1alpha5.Machine) error
- func (c *CloudProvider) Get(_ context.Context, id string) (*v1alpha5.Machine, error)
- func (c *CloudProvider) GetInstanceTypes(_ context.Context, _ *v1alpha5.Provisioner) ([]*cloudprovider.InstanceType, error)
- func (c *CloudProvider) IsMachineDrifted(context.Context, *v1alpha5.Machine) (bool, error)
- func (c *CloudProvider) Name() string
- func (c *CloudProvider) Reset()
- type InstanceTypeOptions
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) GetInstanceTypes ¶
func (c *CloudProvider) GetInstanceTypes(_ context.Context, _ *v1alpha5.Provisioner) ([]*cloudprovider.InstanceType, error)
func (*CloudProvider) IsMachineDrifted ¶
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 }
Click to show internal directories.
Click to hide internal directories.