Skip to content

fix(ec2): FindConvertibleOffering reads one offerings page, so a later-page match is reported as none #426

Closed

Description

@cristim

Summary

FindConvertibleOffering (providers/aws/services/ec2/client.go:859, main 740dfbd) reads a single DescribeReservedInstancesOfferings page (MaxResults: 20) and takes a match from it. The request uses the Filters style that the code comments tie to empty pages that still carry a NextToken. So a valid convertible offering on a later page is reported as "no convertible offering".

Impact

It fails loud, never picks a wrong offering, but a valid RI exchange can be refused. #310 adds an Availability Zone filter and an in-zone check to this lookup and keeps the single page, so this stays open after #310.

Expected

Walk NextToken with a bounded page cap, as ListTargetOfferings does (client.go:994), until a page yields a matching offering. Hitting the cap is an error, not a silent "none".

Test

A fake returning an empty first page with a NextToken and the match on page 2 finds the offering; a fake past the cap errors.

Refs #310, #233.

Activity

  1. cristim commented on Oct 16, 2026

    @cristim
    MemberAuthor

    Fixed on main by #427 (0e95e9f): its second commit made FindConvertibleOffering walk NextToken up to maxTargetOfferingPages and error when it hits the cap, with tests TestFindConvertibleOffering_Zonal_MatchOnSecondPage_FollowsNextToken, _NoMatchAcrossPages_Errors and _PageCapReached_Errors. I filed this issue, so I'm closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions