Skip to content

Commit

Permalink
Deprecate helm 2 support (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Reed authored Nov 10, 2021
1 parent 80d0015 commit 3dd79fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func init() {
rootCmd.PersistentFlags().String("context", "", "A context to use in the kubeconfig.")
viper.BindPFlag("context", rootCmd.PersistentFlags().Lookup("context"))

rootCmd.PersistentFlags().String("helm-version", "3", "Helm version in the current cluster (2|3|auto)")
rootCmd.PersistentFlags().String("helm-version", "3", "DEPRECATED: Only helm 3 usage in the future. Helm version in the current cluster (2|3|auto)")
viper.BindPFlag("helm-version", rootCmd.PersistentFlags().Lookup("helm-version"))

rootCmd.PersistentFlags().Bool("wide", false, "Output chart name and namespace")
Expand Down Expand Up @@ -176,6 +176,9 @@ var clusterCmd = &cobra.Command{
Short: "Find out-of-date deployed releases.",
Long: "Find deployed helm releases that have updated charts available in chart repos",
Run: func(cmd *cobra.Command, args []string) {
if viper.GetString("helm-version") != "3" {
klog.Warning("DEPRECATION: --helm-version explicitly set to either 'auto' or '2'. In v3 of Nova, Helm 2 support will be removed.")
}
h := nova_helm.NewHelm(viper.GetString("helm-version"), viper.GetString("context"))

klog.V(4).Infof("Settings: %v", viper.AllSettings())
Expand Down Expand Up @@ -220,6 +223,9 @@ var genConfigCmd = &cobra.Command{
Short: "Generate a config file.",
Long: "Generate a configuration file with all of the default configuration values.",
Run: func(cmd *cobra.Command, args []string) {
if viper.GetString("helm-version") != "3" {
klog.Warning("DEPRECATION: --helm-version explicitly set to either 'auto' or '2'. In v3 of Nova, Helm 2 support will be removed.")
}
err := viper.SafeWriteConfigAs(cfgFile)
if err != nil {
klog.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Install the golang binary and run it against your cluster.

```
$ go get github.com/fairwindsops/nova
$ nova find --helm-version=auto
$ nova find
Release Name Installed Latest Old Deprecated
cert-manager v0.11.0 v0.15.2 true false
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ meta:
# Usage

```
nova find --helm-version=auto --wide
nova find --wide
```

## Options
* `--config` - Pass a config file that can control the remaining settings. Command-line arguments still take precedence
* `--helm-version` - which version of Helm to use. Options are `2`, `3`, and `auto` (default is `3`)
* `--helm-version` - DEPRECATED: Only helm 3 usage in the future. which version of Helm to use. Options are `2`, `3`, and `auto` (default is `3`)
* `--context` - Sets a specific context in the kubeconfig. If blank, uses the currently set context.
* `-d`, `--desired-versions` - A map of `chart=override_version` to override the helm repository when checking.
* `--wide` - show `Chart Name`, `Namespace` and `HelmVersion`
Expand Down

0 comments on commit 3dd79fd

Please sign in to comment.