Remove references to protobuf and update description of release
object stored representation to Helm v3.
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Helm does not yet properly handle concurrent executions (see #7322),
and invoking Helm concurrently on the same release lead to corrupted storage.
Specifically, several Releases may be marked as DEPLOYED. This patch improved handling of such situations, by taking the latest
DEPLOYED Release. Eventually, the storage will clean itself out, after
the corrupted Releases are deleted due to --history-max.
This is a port to Helm v3 of #7319.
Signed-off-by: Cristian Klein <cristian.klein@elastisys.com>
To use error codes to indicate completion directive to the completion
script had us use os.Exit() in the __complete command. This prevented
go tests calling the __complete command from succeeding.
Another option was to return an error containing an error code
(like is done for helm plugins) instead of calling os.Exit(). However
such an approach requires a change in how helm handles the returned
error of a Cobra command; although we can do this for Helm, it would
be an annoying requirement for other programs if we ever push this
completion logic into Cobra.
The chosen solution instead is to printout the directive at the end
of the list of completions, and have the completion script extract it.
Note that we print both the completions and directive to stdout.
It would have been interesting to print the completions to stdout and
the directive to stderr; however, it is very complicated for the
completion script to extract both stdout and stderr to different
variables, and even if possible, such code would not be portable to
many shells. Printing both to stdout is much simpler.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
The error returned from DeployedAll will never contain "not found".
The error returned at the end of Deployed is already known to be nil,
and we never want to return ls[0] together with a non-nil error anyway.
Signed-off-by: Simon Alling <alling.simon@gmail.com>
Because the 'settings' variable is a pointer, it cannot be used to store
the original envSettings and then restore them.
Instead, this commit creates an entirely new envSettings, after having
set the environment variables, which may affect it.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
The completion of charts was using 'helm search repo' which can be
quite slow as it must parse the entire yaml of every repo cache file.
Using completion for a chart name can end up triggering multiple calls
to 'helm search'; this makes the user experience poor, as there is
a delay of over a second at every <TAB> press.
This commit creates a cache file for each repo which contains the list
of charts for that repo. The completion logic then uses this new
cache file directly and obtains the chart names very quickly.
With only the stable repo configured, this optimization makes the
completion of charts about 85 times faster, going from 1.2 seconds to
0.014 seconds; such a difference gives a much better user experience
when completing chart names.
On the other hand, adding the creation of the chart list cache file to
'helm repo update' or 'helm repo add' is pretty much negligible compared
to the downloading of the index file.
It is also worth noting that when more repos are configured,
'helm search repo' only becomes slower, while the completion logic that
uses the new chart list cache file will not be affected as it only looks
for the single relevant repo file.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
* Include serviceAccount.annotations value
Signed-off-by: Naseem <naseemkullah@gmail.com>
* Add comment about service account annotations
Signed-off-by: Naseem <naseemkullah@gmail.com>
Service accounts must be installed before secrets when service account tokens (secrets) are be managed by Helm. Otherwise Kubernetes will delete any service account token right after creation, since there is no service account mounting the token (see https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#token-controller)
Closes#7159.
Signed-off-by: Daniel Strobusch <1847260+dastrobu@users.noreply.github.com>