Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
5 changes: 2 additions & 3 deletions internal/api/handler_ri_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ var offeringIDPattern = regexp.MustCompile(
// offerings for the source RI identified by ?source_ri_id=<uuid>.
//
// 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
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions internal/api/target_offerings_zone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions internal/server/ri_exchange_zone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading