Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call helm Get to pick up the latest version when there is only … #386

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

xiangjingli
Copy link
Collaborator

@openshift-ci openshift-ci bot added the approved label Feb 5, 2024
@xiangjingli xiangjingli requested review from mikeshng and removed request for lennysgarage and chenz4027 February 5, 2024 20:47
@xiangjingli
Copy link
Collaborator Author

/hold

@xiangjingli
Copy link
Collaborator Author

@mikeshng It turns out the helm Get fails to figure the latest version for the 3.0.0-stable semVer pattern.

I feel the PR may be a easy fix for covering most cases - When specifying the version pattern 3.0.0-stable, users may mainly want to fetch the exact version of the chart, So unlikely they will use this pattern>3.0.0-stable. Then only one version of the chart is fetched. Thus we won't call helm Get to figure out the latest version

Copy link
Member

@mikeshng mikeshng left a comment

Choose a reason for hiding this comment

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

/approve

/lgtm

/unhold

Thanks for the fix @xiangjingli I agree this fix is safe because it relaxes the restriction which fits in our maint mode only policy.

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6cfc950) 55.21% compared to head (36293ca) 55.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #386      +/-   ##
==========================================
+ Coverage   55.21%   55.71%   +0.50%     
==========================================
  Files          71       71              
  Lines       15317    15320       +3     
==========================================
+ Hits         8457     8536      +79     
+ Misses       6011     5932      -79     
- Partials      849      852       +3     
Flag Coverage Δ
unit 55.71% <ø> (+0.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@xiangjingli
Copy link
Collaborator Author

xiangjingli commented Feb 6, 2024

@mikeshng I realized there is a code defect in the previous fix due to my misunderstanding of the indexfile.entries

indexFile.Entries map[string]ChartVersions

Each map index is a chart name, and it could include multiple versions. So checking if there is only one version for the chart should be in each chart by looping the indexFile.Entries

pkg/utils/helmrepo.go Outdated Show resolved Hide resolved
…one version for the given chart

Signed-off-by: Xiangjing Li <xiangli@redhat.com>
Signed-off-by: Mike Ng <ming@redhat.com>
@mikeshng
Copy link
Member

mikeshng commented Feb 6, 2024

/approve

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 6, 2024
Copy link
Contributor

openshift-ci bot commented Feb 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikeshng, xiangjingli

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [mikeshng,xiangjingli]

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

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

Successfully merging this pull request may close these issues.

2 participants