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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache latest chart with proper version on install and upgrade #100

Merged
merged 2 commits into from
Jun 22, 2021

Conversation

hasheddan
Copy link
Contributor

Description of your changes

Currently, when a version is not specified on uxp install or upgrade, we
pull the latest stable chart and cache it without version information in
the dedicated uxp chart cache. This means that if a version that was
installed as the latest was subsequently installed explicitly (i.e. by
providing the version), we would unnecessarily pull the chart again when
it was already in the cache.

This updates the pull logic to save charts pulled as latest with their
appropriate version so that they can be identified in future installs.

Signed-off-by: hasheddan georgedanielmangum@gmail.com

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

I removed the chart cache (rm -rf ~/.cache/up/charts), then ran up uxp install (with no version specified) and observed the proper versioned chart in the cache:

馃 (up) ls ~/.cache/up/charts/
universal-crossplane-1.2.2-up.1.tgz

Currently, when a version is not specified on uxp install or upgrade, we
pull the latest stable chart and cache it without version information in
the dedicated uxp chart cache. This means that if a version that was
installed as the latest was subsequently installed explicitly (i.e. by
providing the version), we would unnecessarily pull the chart again when
it was already in the cache.

This updates the pull logic to save charts pulled as latest with their
appropriate version so that they can be identified in future installs.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Copy link

@AaronME AaronME left a comment

Choose a reason for hiding this comment

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

LGTM

internal/uxp/installers/helm/helm.go Outdated Show resolved Hide resolved
Cleans up the docstring for pullAndLoad which used catch instead of
cache.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
@hasheddan hasheddan merged commit 3a052a7 into upbound:main Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants