From b2a48286e34b22a5cdeaa7b2e5ad1c13c70bce79 Mon Sep 17 00:00:00 2001 From: Cristian Magherusan-Stanciu Date: Sat, 17 Oct 2026 16:45:30 +0200 Subject: [PATCH] chore(deps): bump cloud-commitments-go to 3def3f8 for Archera line items Moves pkg and the aws, azure and gcp providers together to go main, which adds insurance.LineItems, selected amounts and line-item decoding (#799). The go EC2 offering lookups now verify what AWS returns and reject an unparsable payment option instead of ignoring it. Stop forwarding the source RI's AWS offering-type enum ("No Upfront") to ListTargetOfferings, which would now fail every target-offerings request, and make the zone test fakes return offerings that match the query. Refs #799 Co-Authored-By: Claude Opus 5.5 --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- internal/api/handler_ri_exchange.go | 5 ++--- internal/api/target_offerings_zone_test.go | 4 ++++ internal/server/ri_exchange_zone_test.go | 3 +++ 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 5a9c3e3a4..56d536992 100644 --- a/go.mod +++ b/go.mod @@ -84,10 +84,10 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations v1.1.0 github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0 - github.com/LeanerCloud/cloud-commitments-go/pkg v0.0.0-20261016145956-551be568dc21 - github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261016145956-551be568dc21 - github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261016145956-551be568dc21 - github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261016145956-551be568dc21 + github.com/LeanerCloud/cloud-commitments-go/pkg v0.0.0-20261017134002-3def3f898617 + github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261017134002-3def3f898617 + github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261017134002-3def3f898617 + github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261017134002-3def3f898617 github.com/aws/aws-lambda-go v1.47.0 github.com/aws/aws-sdk-go-v2/service/kms v1.50.4 github.com/aws/aws-sdk-go-v2/service/lambda v1.89.0 diff --git a/go.sum b/go.sum index e7eab1429..11c1b111b 100644 --- a/go.sum +++ b/go.sum @@ -92,14 +92,14 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0 github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.54.0/go.mod h1:vB2GH9GAYYJTO3mEn8oYwzEdhlayZIdQz6zdzgUIRvA= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0 h1:s0WlVbf9qpvkh1c/uDAPElam0WrL7fHRIidgZJ7UqZI= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.54.0/go.mod h1:Mf6O40IAyB9zR/1J8nGDDPirZQQPbYJni8Yisy7NTMc= -github.com/LeanerCloud/cloud-commitments-go/pkg v0.0.0-20261016145956-551be568dc21 h1:gZSO852B+hqQWi6lSvPaOWFtWigIw3vVr7HDtX6CMR8= -github.com/LeanerCloud/cloud-commitments-go/pkg v0.0.0-20261016145956-551be568dc21/go.mod h1:SCDEgHG6evjPh0RsoXof+J3aMmGXNFMrwbJIle7rMpQ= -github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261016145956-551be568dc21 h1:Es0vAPXDxERSD6KGQr/ZUg4aVlBAmMsB2XkosI0IqPI= -github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261016145956-551be568dc21/go.mod h1:uOUuTVRjTm0Fhu/Vra2M2NES0w4pvZUSfZLsGyCd18s= -github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261016145956-551be568dc21 h1:PSl5J95u1vS3cvVeci9SkXk/R5iek0NbrxwxxozqyaY= -github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261016145956-551be568dc21/go.mod h1:8vqO2ZlDzjX/Z4bESZVp/IenhTifkySeF0VJwQKihLA= -github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261016145956-551be568dc21 h1:J+c1GcA/i1c3korxqxwkRMOFgJ5OtyeoPxlsU3a3q1U= -github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261016145956-551be568dc21/go.mod h1:KV+Ov04+ZMBGv1wA0s9lEHLinlg1p74XrNafXYLwKmE= +github.com/LeanerCloud/cloud-commitments-go/pkg v0.0.0-20261017134002-3def3f898617 h1:uZXx7Zziae2LrhOHvHRQlMOr35hgNnUl8jNGaPG7I4k= +github.com/LeanerCloud/cloud-commitments-go/pkg v0.0.0-20261017134002-3def3f898617/go.mod h1:SCDEgHG6evjPh0RsoXof+J3aMmGXNFMrwbJIle7rMpQ= +github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261017134002-3def3f898617 h1:nfrGAD+48vStyTHliIZyBp1l2LtVv47MedgNgtkcAnc= +github.com/LeanerCloud/cloud-commitments-go/providers/aws v0.0.0-20261017134002-3def3f898617/go.mod h1:dc2TUUYOwkEaX90zQX1nvVQU85y9GVZrAt4YkuLxZ9A= +github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261017134002-3def3f898617 h1:K9wBX9ac1QwhkjW7BvDt0gl2Kt9fGdDytJyndoPRcBU= +github.com/LeanerCloud/cloud-commitments-go/providers/azure v0.0.0-20261017134002-3def3f898617/go.mod h1:iOwl8e9EKGb3VQ4u/YjiqVzglhD6/GX1ABC3tBkqu0A= +github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261017134002-3def3f898617 h1:VYVbQyoR+tIcPoXhkviclexKuU5H+A21hSXudB+kZag= +github.com/LeanerCloud/cloud-commitments-go/providers/gcp v0.0.0-20261017134002-3def3f898617/go.mod h1:03vjHt5wlHtZEFAFOhosA+paDSqacWnKg9cVa68QnJ0= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI= diff --git a/internal/api/handler_ri_exchange.go b/internal/api/handler_ri_exchange.go index 489cd5920..cefad76e7 100644 --- a/internal/api/handler_ri_exchange.go +++ b/internal/api/handler_ri_exchange.go @@ -106,8 +106,8 @@ var offeringIDPattern = regexp.MustCompile( // offerings for the source RI identified by ?source_ri_id=. // // The handler looks up the source RI from DescribeReservedInstances, -// extracts its ProductDescription / Tenancy / Scope / Duration / -// OfferingType, and passes those to ec2svc.ListTargetOfferings which +// extracts its ProductDescription / Tenancy / Scope / Duration, +// and passes those to ec2svc.ListTargetOfferings which // calls DescribeReservedInstancesOfferings with the same typed-field // shape used by PR #690. Instance type is intentionally omitted from // the query so AWS returns all valid target instance types -- the full @@ -174,7 +174,6 @@ func targetOfferingsForSource(ctx context.Context, ec2Client targetOfferingsEC2C Scope: sourceRI.Scope, AvailabilityZone: sourceRI.AvailabilityZone, Duration: sourceRI.Duration, - OfferingType: sourceRI.OfferingType, }) if err != nil { if isOfferingZoneRefusal(err) { diff --git a/internal/api/target_offerings_zone_test.go b/internal/api/target_offerings_zone_test.go index 9aa5b82f2..9d33dff91 100644 --- a/internal/api/target_offerings_zone_test.go +++ b/internal/api/target_offerings_zone_test.go @@ -36,6 +36,10 @@ func (a *zoneRecordingTargetsAPI) DescribeReservedInstancesOfferings(_ context.C ReservedInstancesOfferingId: aws.String("4b2293b4-5fbc-4017-9c75-d5a9d3aa8c91"), InstanceType: ec2types.InstanceType("m5.xlarge"), AvailabilityZone: in.AvailabilityZone, + OfferingClass: in.OfferingClass, + InstanceTenancy: in.InstanceTenancy, + Duration: in.MinDuration, + OfferingType: in.OfferingType, }}, }, nil } diff --git a/internal/server/ri_exchange_zone_test.go b/internal/server/ri_exchange_zone_test.go index dda90ad67..72b2f0b54 100644 --- a/internal/server/ri_exchange_zone_test.go +++ b/internal/server/ri_exchange_zone_test.go @@ -42,6 +42,9 @@ func (a *zoneRecordingEC2API) DescribeReservedInstancesOfferings(_ context.Conte ReservedInstancesOfferings: []ec2types.ReservedInstancesOffering{{ ReservedInstancesOfferingId: aws.String("offering-in-zone"), AvailabilityZone: in.AvailabilityZone, + OfferingClass: ec2types.OfferingClassTypeConvertible, + InstanceTenancy: ec2types.TenancyDefault, + Duration: aws.Int64(31536000), }}, }, nil }