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

Optionally build index.yaml in an idempotent fashion #133

Open
colearendt opened this issue Aug 18, 2021 · 2 comments
Open

Optionally build index.yaml in an idempotent fashion #133

colearendt opened this issue Aug 18, 2021 · 2 comments

Comments

@colearendt
Copy link

It would be nice if there were a way to "build an index.yaml from GitHub release metadata" in an idempotent fashion

In some cases, a git repository can get broken and mess up the index.yaml / the index.yaml gets out of sync with the git releases that are stored on GitHub. This happens most often when there are errors in the chart-releaser action - for instance, a submodule that did not clone properly, etc. From this scenario, it is non-trivial to build an index.yaml from the git release metadata.

It can also be a nice way to sanity check that the organically built / "pet" index.yaml matches up with git state.

We had a need for such work and wrote up a bash script to fit the bill in the short term: latest // permalink

We also wrote a GitHub action to allow triggering this adhoc when needed: latest // permalink

If it is useful to anyone in the meantime, shout out to @jonyoder who did the actual implementation 😄

NOTE: the script is not perfect and can modify an index.yaml / create duplicates in some cases. Further, it is not perfectly idempotent because timestamps will be updated. It is good enough for us at the moment, but would love to see a proper fix. An example PR: rstudio/helm#21

@fog1985
Copy link

fog1985 commented Nov 26, 2021

I have just faced this issue as well.
Had index.yaml is fully spoiled.
There were a lot of old and non-existing releases already.
So clean it up manually. Would be nice to have it re-generated nicely with what is relevant and in accordance with the real repository releases.

colearendt added a commit to colearendt/couchdb-helm that referenced this issue May 27, 2022
@colearendt
Copy link
Author

colearendt commented Jun 18, 2022

In particular, timestamps are concerning. However:

I am going to mull over options for a way to pass this created timestamp to helm without changing the signature of MustAdd, although that seems unlikely 😢 It's also possible that chart-releaser could workaround somehow by modifying the created timstamps after helm's work, etc..., but that also has its own downsides (e.g. feeling very gross)

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

No branches or pull requests

2 participants