Skip to content

Commit

Permalink
chore: Add scheduling testing support for v1beta1 APIs (kubernetes-…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Sep 15, 2023
1 parent 040a868 commit 10bbc2d
Show file tree
Hide file tree
Showing 6 changed files with 6,385 additions and 3,145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
)

var _ = Describe("Instance Type Selection", func() {
var provisioner *v1alpha5.Provisioner
var minPrice float64
var instanceTypeMap map[string]*cloudprovider.InstanceType
nodePrice := func(n *v1.Node) float64 {
Expand All @@ -46,17 +47,19 @@ var _ = Describe("Instance Type Selection", func() {
}

BeforeEach(func() {
// open up the provisioner to any instance types
provisioner.Spec.Requirements = []v1.NodeSelectorRequirement{
provisioner = test.Provisioner(test.ProvisionerOptions{Requirements: []v1.NodeSelectorRequirement{
{
Key: v1alpha5.LabelCapacityType,
Operator: v1.NodeSelectorOpIn,
Values: []string{v1alpha5.CapacityTypeSpot, v1alpha5.CapacityTypeOnDemand},
},
{
Key: v1.LabelArchStable,
Operator: v1.NodeSelectorOpIn,
Values: []string{v1alpha5.ArchitectureArm64, v1alpha5.ArchitectureAmd64},
},
}
cloudProvider.CreateCalls = nil
}})
cloudProvider.InstanceTypes = fake.InstanceTypesAssorted()

instanceTypeMap = getInstanceTypeMap(cloudProvider.InstanceTypes)
minPrice = getMinPrice(cloudProvider.InstanceTypes)

Expand Down
Loading

0 comments on commit 10bbc2d

Please sign in to comment.