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

Download icons locally when running make charts #124

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

diogoasouza
Copy link
Contributor

@diogoasouza diogoasouza commented Jan 11, 2024

When running the make charts command, it will check if the icon is pointing to a HTTP URL, and if so, download it and change the Chart.yaml to generated from the packages folder to point to it

Copy link
Member

@rohitsakala rohitsakala left a comment

Choose a reason for hiding this comment

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

I have two concerns here

  1. This kind of logic will make the Chart.yaml inside chart tar differ from index.yaml. This voilates one of the checkpoints we have when we release a chart.
  2. We are modifying metadata of something that is already in released and in use for old versions.

Alternate Solution

  • Can we consider a make target which blocks a user in adding a version of a chart that has chart.icon not pointing to file://.assets/logos/{image}.png

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
pkg/icons/icons.go Outdated Show resolved Hide resolved
pkg/icons/icons.go Outdated Show resolved Hide resolved
pkg/icons/icons.go Outdated Show resolved Hide resolved
for name := range helmIndexFile.Entries {
latestEntryVersion := helmIndexFile.Entries[name][0]
latestIconName := name
if strings.Contains(name, "-crd") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

// We don't add any icons for "CRD" because they are not displayed as installable charts

return nil
}

func download(rootFs billy.Filesystem, url, path string) (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is not needed for rancher/charts
But for rancher/partner-charts if possible and if we are the ones who will implement this same strategy.
I would consider a for loop with go functions for the download execution.
120+ rancher partner charts

@diogoasouza diogoasouza force-pushed the add-make-icon branch 3 times, most recently from 270b6ee to de302cd Compare January 12, 2024 21:52
@diogoasouza diogoasouza changed the title adding make icons Download icons locally when running make charts Jan 12, 2024
Copy link
Contributor

@lucasmlp lucasmlp left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Contributor

@lucasmlp lucasmlp left a comment

Choose a reason for hiding this comment

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

Tried to run make validate against dev-v2.9 and it broke

@diogoasouza diogoasouza force-pushed the add-make-icon branch 3 times, most recently from d6192b5 to a19a0b0 Compare January 15, 2024 23:08
@diogoasouza diogoasouza requested a review from lucasmlp January 15, 2024 23:30
pkg/helm/export.go Outdated Show resolved Hide resolved
Copy link
Contributor

@lucasmlp lucasmlp left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@diogoasouza diogoasouza merged commit 10fb598 into rancher:master Jan 17, 2024
4 checks passed
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.

4 participants