Skip to content

Commit 85616bc

Browse files
cherry-pick(1.2.x): fix: Fix spot pricing data being overridden when fetched (#7877) (#7885)
Co-authored-by: Jonathan Innis <jonathan.innis.ji@gmail.com>
1 parent 477072f commit 85616bc

File tree

9 files changed

+489
-264
lines changed

9 files changed

+489
-264
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ require (
2424
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240229193347-cfab22a10647
2525
github.com/awslabs/operatorpkg v0.0.0-20241205163410-0fff9f28d115
2626
github.com/go-logr/zapr v1.3.0
27+
github.com/google/uuid v1.6.0
2728
github.com/imdario/mergo v0.3.16
2829
github.com/jonathan-innis/aws-sdk-go-prometheus v0.1.1
2930
github.com/mitchellh/hashstructure/v2 v2.0.2
@@ -80,7 +81,6 @@ require (
8081
github.com/google/go-cmp v0.6.0 // indirect
8182
github.com/google/gofuzz v1.2.0 // indirect
8283
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
83-
github.com/google/uuid v1.6.0 // indirect
8484
github.com/inconshreveable/mousetrap v1.1.0 // indirect
8585
github.com/jmespath/go-jmespath v0.4.0 // indirect
8686
github.com/josharian/intern v1.0.0 // indirect

pkg/cloudprovider/suite_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ var _ = Describe("CloudProvider", func() {
319319
awsEnv.EC2API.DescribeInstanceTypesOutput.Set(&ec2.DescribeInstanceTypesOutput{InstanceTypes: instances})
320320
awsEnv.EC2API.DescribeInstanceTypeOfferingsOutput.Set(&ec2.DescribeInstanceTypeOfferingsOutput{InstanceTypeOfferings: fake.MakeInstanceOfferings(instances)})
321321
now := time.Now()
322-
awsEnv.EC2API.DescribeSpotPriceHistoryOutput.Set(&ec2.DescribeSpotPriceHistoryOutput{
322+
awsEnv.EC2API.DescribeSpotPriceHistoryBehavior.Output.Set(&ec2.DescribeSpotPriceHistoryOutput{
323323
SpotPriceHistory: []ec2types.SpotPrice{
324324
{
325325
AvailabilityZone: aws.String("test-zone-1a"),
@@ -417,7 +417,7 @@ var _ = Describe("CloudProvider", func() {
417417
awsEnv.EC2API.DescribeInstanceTypesOutput.Set(&ec2.DescribeInstanceTypesOutput{InstanceTypes: instances})
418418
awsEnv.EC2API.DescribeInstanceTypeOfferingsOutput.Set(&ec2.DescribeInstanceTypeOfferingsOutput{InstanceTypeOfferings: fake.MakeInstanceOfferings(instances)})
419419
now := time.Now()
420-
awsEnv.EC2API.DescribeSpotPriceHistoryOutput.Set(&ec2.DescribeSpotPriceHistoryOutput{
420+
awsEnv.EC2API.DescribeSpotPriceHistoryBehavior.Output.Set(&ec2.DescribeSpotPriceHistoryOutput{
421421
SpotPriceHistory: []ec2types.SpotPrice{
422422
{
423423
AvailabilityZone: aws.String("test-zone-1a"),
@@ -516,7 +516,7 @@ var _ = Describe("CloudProvider", func() {
516516
awsEnv.EC2API.DescribeInstanceTypesOutput.Set(&ec2.DescribeInstanceTypesOutput{InstanceTypes: uniqInstanceTypes})
517517
awsEnv.EC2API.DescribeInstanceTypeOfferingsOutput.Set(&ec2.DescribeInstanceTypeOfferingsOutput{InstanceTypeOfferings: fake.MakeInstanceOfferings(uniqInstanceTypes)})
518518
now := time.Now()
519-
awsEnv.EC2API.DescribeSpotPriceHistoryOutput.Set(&ec2.DescribeSpotPriceHistoryOutput{
519+
awsEnv.EC2API.DescribeSpotPriceHistoryBehavior.Output.Set(&ec2.DescribeSpotPriceHistoryOutput{
520520
SpotPriceHistory: []ec2types.SpotPrice{
521521
{
522522
AvailabilityZone: aws.String("test-zone-1a"),

0 commit comments

Comments
 (0)