sonatype-nexus-community / helm-nexus-push

A plugin for helm that will push a chart to a Nexus Hosted Repository
Apache License 2.0
43 stars 47 forks source link

Helm3 support #9

Closed xxfatumxx closed 4 years ago

xxfatumxx commented 4 years ago

(In Helm version 3.x.x helm home doesn't work, so I've changed location for auth.REPO file. Helm version 2.x.x will work as well.

This pull request makes the following changes:

Helm3 support

xxfatumxx commented 4 years ago

Thank you for the tip @dtshepherd Just made additional commit with changes. Please review when you can.

eshepelyuk commented 4 years ago

@dtshepherd I don't think this PR gonna work

  1. reading from $HOME/.config/helm/auth.$REPO would not work, because
    • on windows the different folder is used ( in %APPDATA%)
    • one could redefine XDG_* family of variables to be outside HOME So, helm env should be used instead to detect the location of configs
  2. as far as I see helm3 stores repo data in YAML file, called repository.yaml, so to reuse auth one need to parse that yaml
  3. USERNAME and PASSWORD definately should not be used, since it gives an illusion that smth is read from helm configs, instead USERNAME is taken from default shell variables
xxfatumxx commented 4 years ago

@eshepelyuk helm env works only in Helm 3 version. But I absolutely agree that this plugin could be run (in container, for example) under user with no definite home dir or initialized HOME variable. I'll fix this and another small bug with PASSWORD variable in next PR.

dtshepherd commented 4 years ago

Yeah a buddy of mine gave me a heads up about the XDG yesterday. We’ll need to rework this to be a bit more generic. I don’t think the PR made things any worse though?

eshepelyuk commented 4 years ago

Nope, nothing worse. Just mentioning that Helm3 needs much more support and rework.

eshepelyuk commented 4 years ago

Maybe it worth to separate Helm2 and Helm3 plugins (using branches, for instance) ?