The warnings introduced when a chart has been deprecated is displayed on standard out. This is a regression for users piping the output of `helm template` from a deprecated chart to `kubectl`. This changes the error message to display on standard error instead.
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
Currently, whenever the chart is printed, the digest of the .tar.gz
content layer is printed as the digest. The manifest digest is important
for OCI purposes, particularly in pushing to a registry.
Resolves#8248.
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
This commit allows to use shell completion to obtain the list of
available versions of a chart referenced in a 'repo/chart' format.
It applies to:
- helm install
- helm template
- helm upgrade
- helm show
- helm pull
The 'repo/chart' argument must be present for completion to be triggered
(or else we don't yet know which chart to fetch the versions for).
The completion can be slow for the 'stable' repo because its index
file takes some time to parse.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Making each shell a subcommand of the 'completion' has multiple
advantages:
- simplifies the code,
- allows to have different flags for each shell,
for example, a future `--no-descriptions` flag for fish only,
- allows to tailor the help text per shell.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Cobra 1.0 introduces custom Go completions. This commit replaces Helm's
own solution to use Cobra's solution.
This allows to completely remove Helm's internal "completion" package.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
The flags added by addChartPathOptionsFlags() are used for
`helm install` and `helm upgrade` but also for `helm template`,
`helm show` and `helm pull`. Because of the latter three, we should not
use the word 'install' in the description of the --version and --verify
flags.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Add a unit test that proves the digest of the received content being
checked. The check should ensure that the digest of the received content
is identical to the digest provided by the manifest in the layers[0]
descriptor. This check is currently implemented in containerd, so the
unit test ensures security in the case a breaking change is made in
containerd.
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Having both the `showCmd` and the `subCmd` passed to `addShowFlags()`
can easily lead to mistakes in using the wrong command.
Instead, `addShowFlags()` should only focus on the `subCmd`
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
With a large list of charts, `helm chart list` will crash with the
following message:
```
$ helm chart list --debug
Error: open
/home/me/.cache/helm/registry/cache/blobs/sha256/109971e44d63f7fd11fff60d19db41c2429a136943be2e3f8fd3e4c165156536:
too many open files
helm.go:75: [debug] open
/home/me/.cache/helm/registry/cache/blobs/sha256/109971e44d63f7fd11fff60d19db41c2429a136943be2e3f8fd3e4c165156536:
too many open files
```
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
If stat returns an error other than the directory not existing
it was unhandled. When IsDir is called in one of these situations
it causes a panic.
Closes#8181
Signed-off-by: Matt Farina <matt@mattfarina.com>
This file was previously used for shell completions but is
no longer in use as there is a new completions system in place
and there has been for some time.
The contents of this file were out of date and reflect Helm v2.
Closes#8186
Signed-off-by: Matt Farina <matt@mattfarina.com>
Persistent flags are available on subcommands. Status does not
need the persistent nature.
Closes#8149
Signed-off-by: Matt Farina <matt@mattfarina.com>