Skip to content

Conversation

@olucasfreitas
Copy link
Contributor

@olucasfreitas olucasfreitas commented Feb 10, 2026

Details

This PR adds the capacity-reservation-preference field to the output of rosa describe machinepool, so users can see what preference was set on their node pool.


Fixed Behavior

./rosa describe machinepool --cluster=mycluster test-np

Output:

...
Capacity Reservation:                  
 - Preference:                         open
Management upgrade:                    
...

Now the user can see the preference they configured.


Additional Cases

The existing output for capacity reservations with an ID continues to work as before:

  1. ID + Type (no preference):

    Capacity Reservation:                  
     - ID:                                 cr-abc123
     - Type:                               OnDemand
    
  2. ID + Type + Preference:

    Capacity Reservation:                  
     - ID:                                 cr-abc123
     - Type:                               OnDemand
     - Preference:                         capacity-reservations-only
    
  3. Preference only (new):

    Capacity Reservation:                  
     - Preference:                         open
    

Ticket

Closes OCM-20977

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 10, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: olucasfreitas
Once this PR has been reviewed and has the lgtm label, please assign jerichokeyne for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@olucasfreitas olucasfreitas marked this pull request as ready for review February 10, 2026 17:22
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 10, 2026
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 24.05%. Comparing base (71b5ecf) to head (d5bade2).
⚠️ Report is 86 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3192      +/-   ##
==========================================
+ Coverage   23.97%   24.05%   +0.07%     
==========================================
  Files         329      329              
  Lines       35908    35916       +8     
==========================================
+ Hits         8609     8639      +30     
+ Misses      26646    26623      -23     
- Partials      653      654       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

id, ok := capacityReservation.GetId()
if !ok {
return ""
id, hasId := capacityReservation.GetId()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of convention, I would like hasId to become ok 🙂 its just a convention that we use

Comment on lines 173 to 185
preference, ok := capacityReservation.GetPreference()
if !ok {
return fmt.Sprintf("\n"+
" - ID: %s\n"+
" - Type: %s",
id, marketType)
}
return fmt.Sprintf("\n"+
" - ID: %s\n"+
" - Type: %s\n"+
" - Preference: %s",
id, marketType, preference)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like we already have preference added here, I think the issue might be more complicated than just 'we forgot it'

It looks like we are returning early before returning this block with the preference, I think the right solution for this ticket would be to fix the issue directly, rather than stack on a couple new if statements and a return

Likely, one of the above returns is being used before this one is, causing the preference to not be visible, and we should figure out why

Also there's quite a few tests introduced in this MR, I think what would be important would be to directly test the outcome, so keep the cmd_test.go changes, but we don't need anything else beyond that, unless a test fails (in that case, we should modify it)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants