we want to force a cache invalidation to ensure that the Capabilities object always has the latest information from the server (Kubernetes server version, available API versions, etc). `kubectl version` forces a cache invalidation every time it's invoked, so this seems like a safe change that is identical to kubectl's behaviour.
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
This ports the functionality of cleanup on fail to v3 as introduced in #4871. This has been tested manually
and would be a good candidate for a new acceptance test.
Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
The binary of Helm to use for dynamic completion should be the same
as the actual Helm binary being used. For example, if PATH points
to a version of helm v2, but the user calls bin/helm to use a local
v3 version, then dynamic completion should also use bin/helm.
If not, in this example, the dynamic completion will use the
information returned by helm v2.
This improvement is particularly useful for users that will run both
helm v2 and helm v3 at the same time.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
* Use `apps/v1` for Deployment
* Reformat comments
* Consistently use `nindent` and indent properly
* Introduce named template for selector labels
* Fix label selector in `NOTES.txt`
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
It makes sense to limit the history by default. Setting
it to 10 aligns with the default for a ReplicaSet's
`revisionHistoryLimit`.
Fixes: #5157
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
Inspired greatly from kubectl code.
Completion is provided for:
--kube-context - where the available contexts are listed
--namespace - where the namespaces of the cluster are listed
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
This is a bug I ran into when working on Helm completion.
I was surprised that it didn't happen when I was using
kubectl, so I investigated and found a PR that fixed this
bug in kubectl:
https://github.com/kubernetes/kubernetes/pull/48553
I duplicated the code in this commit which:
Removes __helm_declare, which is safe to do since
`declare -F` is already replaced to `whence -w` by
__helm_convert_bash_to_zsh().
The problem was that calling "declare" from inside a function
scopes the declaration to that function only. So "declare"
should not be called through __helm_declare() but instead
directly.
To reproduce:
1- setup helm completion in zsh
2- helm --kubeconfig=$HOME/.kube/config statu<TAB>
you will get the error:
__helm_handle_flag:27: bad math expression: operand expected at end of string
Co-authored-by: Kazuki Suda <kazuki.suda@gmail.com>
Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
Cobra provides some out-of-the-box debugging for bash completion.
To use it, one must set the variable BASH_COMP_DEBUG_FILE to
some file where the debug output will be written. Many of the
debug printouts indicate the current method name; they do so
by using bash's ${FUNCNAME[0]} variable. This variable is
different in zsh. To obtain the current method name in zsh
we must use ${funcstack[0]}.
This commit adds the proper sed modification to convert from
bash to zsh.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Have fixed up a non-blocking nitpick change from #6310, this just
switches us to use a regular string rather than a string.Builder for the
summary.
Signed-off-by: Thomas O'Donnell <andy.tom@gmail.com>
* fix: clear the discovery cache after CRDs are installed
This fixes an issue in which a chart could not contain both a CRD and an instance of that CRD. It works around a stale cache by force cache invalidation whenever a CRD is added.
Closes#6316
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
* fix: wait for CRD to register before allowing CRDs to be installed
This fixes an issue with the previous version of this patch in which the CRD would not be available quickly enough.
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
* feat: use Wait() to wait for CRDs to be ready
This forward-ports the CRD wait logic to Helm 3, and then uses that to wait for CRDs to be registered.
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
* ref: moved the scheme modification to an appropriate place.
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
* fix: turned warnings into fatal errors, fixed spelling, clear cache once
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>