Fix `repo add` and `repo update` to use a repository cache set
using `--repository-cache` flag
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Signed-off-by: Trond Hindenes <trond@hindenes.com>
Cobra 1.0.0 introduces support for Custom Go Completions. However,
there is a small difference compared to helm's existing solution.
The difference is that Cobra will not complete sub-commands if there
are any dynamic completion functions registered.
The way helm implemented plugin completions had the dynamic completion
function associated with the root plugin command (e.g. 2to3); with
Cobra, this prevents any of the sub-commands of the plugin to be
completed (i.e., 2to3 <TAB> will not show the static sub-commands).
The solution is to only register the dynamic completion function for a
plugin command that doesn't have any further sub-commands. This allows
all sub-commands to be completed properly, and when there are no more
levels of sub-commands, the dynamic completion is called.
This commit had to make two changes to achieve this:
1- refactor the load_plugins.go file to extract the logic to call
the plugin.complete executable (for dynamic completions), so that
it could be added to each final sub-command.
2- load the static completion not only for the "completion" command like
before, but also for the "__complete" command, so that when the
__complete command is called for dynamic completion of a sub-command,
it is aware of the sub-command in question.
The second change is also valuable for the future support of completion
for the Fish shell. Completion for the fish shell uses the __complete
command not only for dynamic completions but also for basic command and
flag completion. This implies that the __complete command must be aware
of the plugins sub-commands, and therefore that the plugin's static
completion be loaded.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Since we've moved to Go 1.14, golangci-lint has been silently failing.
This commit updates to a compatible version.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
* Fixing issue with PAX headers in plugin archive
PAX Headers can be added by some systems that create archives. Helm
should ignore them when extracting.
There are two PAX headers. One is global and the other is not. Both
are ignored. The test adds only the PAX global header because the
Go tar package is unable to write the header that is not global.
Closes#8084
Signed-off-by: Matt Farina <matt@mattfarina.com>
* Removing the PAX header test as it is not working
The PAX header test was making a WriteHeader call and ignoring the
error. When writing the type TypeXHeader it was causing an error
that was being silently ignored. The Go tar package cannot write
this type and produces an error when one tries to. The error reads
"cannot manually encode TypeXHeader, TypeGNULongName, or TypeGNULongLink
headers"
Signed-off-by: Matt Farina <matt@mattfarina.com>
* Adding check of returned error in test
Adding a check for the returned error to make sure a non-nil value
is not returned.
Signed-off-by: Matt Farina <matt@mattfarina.com>
When installing Helm, the following warning gets printed on the console:
Downloading https://get.helm.sh/helm-v2.16.6-linux-amd64.tar.gz
Preparing to install helm and tiller into /usr/local/bin
helm installed into /usr/local/bin/helm
tiller installed into /usr/local/bin/tiller
main: line 178: which: command not found
Run 'helm init' to configure helm.
The 'which' command is optional, and not always installed on all
environments (like a Fedora container). Instead, use 'command -v' to
detect if the executable is in the $PATH.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
* fix: make the linter coalesce the passed-in values before running values tests
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
* fixed typo
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Add api group:
- apiextensions.k8s.io/v1beta1
- rbac.authorization.k8s.io/v1alpha1
Also, some kinds moved from extensions/v1 to extensions/v1beta1
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
A chart being installed which only contains CRDs and not
any templates tries to install the resources by default.
The resourceList which is used in this case does not check
if there are resources present in it or not. This commit
adds checks to those particular places where we need to check
if the size of resourceList > 0 during installation and deletion.
Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
Helm had been exposing XDG based variables to end users. This lead
to confusion. For example, if a user wanted to change the cache
location Helm used should they change the XDG variable? Since this
would be like changing the HOME environment variable the answer
is no.
This change adds HELM_*_HOME environment variables to be used
in addition to XDG ones of the same name. Helm will now look
for the Helm specific variable. If not set, Helm will fall
back to XDG locations. If those are not set a default location
will be used. This keeps XDG in use as a default when present,
provides users with the ability to set the location, and removes
XDG from being exposed to end users to avoid confusion.
Closes#7919
Signed-off-by: Matt Farina <matt@mattfarina.com>