This fixes the error output to display the error's default value (the error message) rather than
Go's internal representation of its value.
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
Refer to the stderr manpage:
$ man 3 stderr
*Note that mixing use of FILEs and raw file descriptors can produce unexpected results and should generally be avoided.*
And actually, we noticed that the warning() will output the message to
stdout instead of stderr sometimes.
lizj@FNSTPC:~/workspace/k8s/helm$ while true; do timeout 1m go test -count=1 -run TestCheckPerms ./cmd/helm -v 2>/dev/null; done
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.028s
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.027s
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.028s
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.029s
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.029s
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.028s
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.030s
=== RUN TestCheckPerms
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /tmp/helmtest093620773/testconfig
=== RUN TestCheckPerms
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /tmp/helmtest083469215/testconfig
=== RUN TestCheckPerms
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /tmp/helmtest101343249/testconfig
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.032s
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.040s
=== RUN TestCheckPerms
--- PASS: TestCheckPerms (0.00s)
PASS
ok helm.sh/helm/v3/cmd/helm 0.031s
=== RUN TestCheckPerms
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /tmp/helmtest706352639/testconfig
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Remove klog flags from help text. No change to behavior.
```
...
Flags:
--debug enable verbose output
-h, --help help for helm
--kube-apiserver string the address and the port for the Kubernetes API server
--kube-context string name of the kubeconfig context to use
--kube-token string bearer token used for authentication
--kubeconfig string path to the kubeconfig file
-n, --namespace string namespace scope for this request
--registry-config string path to the registry config file (default "/Users/areese/.config/helm/registry.json")
--repository-cache string path to the file containing cached repository indexes (default "/Users/areese/.cache/helm/repository")
--repository-config string path to the file containing repository names and URLs (default "/Users/areese/.config/helm/repositories.yaml")
```
Signed-off-by: Adam Reese <adam@reese.io>
When #8779 was merged it introduced an issue with windows builds,
which we do not test for in PR CI. This change fixes that problem.
Signed-off-by: Matt Farina <matt@mattfarina.com>
A security issue fixed in 3.3.2 caught repos with the same name
being added a second time and produced an error. This caused an
issue for tools, such as helmfile, that will add the same name
with the same configuration multiple times.
This fix checks that the configuration on the existing and new
repo are the same. If there is no change it notes it and exists
with a 0 exit code. If there is a change the existing error is
returned (for reverse compat). If --force-update is given the
user opts in to changing the config for the name.
Closes#8771
Signed-off-by: Matt Farina <matt@mattfarina.com>
For backward compatibility, as suggested by @bacongobbler, we introduce
a new API NewTempServerWithCleanup
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
With Cobra 1.0, it is now possible to control when file completion
should or should not be done. For example:
helm list <TAB>
should not trigger file completion since 'helm list' does not accept
any arguments.
This commit disables file completion when appropriate and adds tests to
verify that file completion is properly disabled.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
When #8156 was merged it had the side effect that all hooks were
run all the time. All the hooks were put in the flow of the
content rendered and sent to Kubernetes on every command.
For example, if you ran the following 2 commands the test hooks
would run:
helm create foo
helm install foo ./foo
This should not run any hooks. But, the generated test hook is run.
The change in this commit moves the writing of the hooks to output
or disk back into the template command rather than in a private
function within the actions. This is where it was for v3.2.
One side effect is that post renderers will not work on hooks. This
was the case in v3.2. Since this bug is blocking the release of v3.3.0
it is being rolled back. A refactor effort is underway for this section
of code. post renderer for hooks should be added back as part of that
work. Since post renderer hooks did not make it into a release it
is ok to roll it back for now.
There is code in the cmd/helm package that has been duplicated from
pkg/action. This is a temporary measure to fix the immediate bug
with plans to correct the situation as part of a refactor
of renderResources.
Signed-off-by: Matt Farina <matt@mattfarina.com>
* fix(sdk): Polish the downloader/manager package error return
Close#8471
Signed-off-by: Dong Gang <dong.gang@daocloud.io>
* Modify the repositories validation function `resloveRepoNames` and add a
unit test.
Signed-off-by: Dong Gang <dong.gang@daocloud.io>
* Remove wrong commit
Signed-off-by: Dong Gang <dong.gang@daocloud.io>