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

PR Discussion: require --force-publish-chart to override charts during --publish-charts #73

Closed
consideRatio opened this issue Oct 30, 2019 · 2 comments · Fixed by #102
Closed
Labels
enhancement New feature or request

Comments

@consideRatio
Copy link
Member

In ccbbba7 I documented the current procedure for --publish-chart.

We currently act as if we have a --force-publish-chart flag set by default when we use --publish-chart. I think we should require --force-publish-chart to be passed to get the current behavior where a new chart of the same version will override an existing chart.

This relates to #60 that is about making chartpress provide a easy way to check if a chart is already published before running tests etc again if nothing has changed.

@consideRatio consideRatio changed the title PR Discussion: require --force-publish-chart to override charts PR Discussion: require --force-publish-chart to override charts during --publish-charts Oct 30, 2019
@consideRatio
Copy link
Member Author

I've considered how to go about the check if the chart is already published. I think the way to go is to not checkout the git repository, it is after all supposed to be a helm chart registry somewhere, so simply accessing the index.yaml directly and looking for the chart version may make more sense. Checking out a single file from a git repo isn't easy without cloning every file, at least not in a systematic way as GitHub forbits the use of git archive that would enable that but instead would allow for more web-server request related ways...

Hmm... Yeah working directly with the helm chart registry index.yaml file seems to make the most sense. It will require the helm chart registry to be live on the web though, but that may be fine.

@consideRatio
Copy link
Member Author

consideRatio commented Nov 2, 2019

Implementation idea

What we need

A function that returns true or false depending on if a helm chart repository (with a index.yaml file in it) contains a passed URL.

How we do it

def _has_chart(chart_name, chart_version, chart_repo_url):
    # get the chart_repo_url
    # check if the chart_name / chart_version is listed within chart_repo_url/index.yaml
    # --- https://jupyterhub.github.io/helm-chart/index.yaml
    # --- parse yaml into python object using the available `yaml` object from ruamel-yaml
    # --- loop over index_yaml["entries"]["name-of-chart"]
    # --- look for an entry with an exact matching version field.
    # return True / False

How we test it

We run it against https://jupyterhub.github.io/helm-chart to see if it can find known jupyterhub versions for example, and some non-existing version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant