mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
* feat: add first class support to access repositories using proxy Currently, users need to set the proxy URLs as env variables in the repo server. This is not user-friendly and also error-prone. This PR adds support to maintain proxy URLs along with repository configs in the argocd-cm. Argo CD uses this proxy to access your repository. In case the custom proxy is absent, it defaults to reading the proxy from the env variables. Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com> * set both http & https proxy variables Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
54 lines
1.4 KiB
Go
54 lines
1.4 KiB
Go
package helm
|
|
|
|
import (
|
|
"log"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_cmd_redactor(t *testing.T) {
|
|
assert.Equal(t, "--foo bar", redactor("--foo bar"))
|
|
assert.Equal(t, "--username ******", redactor("--username bar"))
|
|
assert.Equal(t, "--password ******", redactor("--password bar"))
|
|
}
|
|
|
|
func TestCmd_template_kubeVersion(t *testing.T) {
|
|
cmd, err := NewCmdWithVersion(".", HelmV3, false, "")
|
|
assert.NoError(t, err)
|
|
s, err := cmd.template("testdata/redis", &TemplateOpts{
|
|
KubeVersion: "1.14",
|
|
})
|
|
assert.NoError(t, err)
|
|
assert.NotEmpty(t, s)
|
|
}
|
|
|
|
func TestNewCmd_helmV2(t *testing.T) {
|
|
cmd, err := NewCmd(".", "v2", "")
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, "helm2", cmd.HelmVer.binaryName)
|
|
}
|
|
|
|
func TestNewCmd_helmV3(t *testing.T) {
|
|
cmd, err := NewCmd(".", "v3", "")
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, "helm", cmd.HelmVer.binaryName)
|
|
}
|
|
|
|
func TestNewCmd_helmDefaultVersion(t *testing.T) {
|
|
cmd, err := NewCmd(".", "", "")
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, "helm", cmd.HelmVer.binaryName)
|
|
}
|
|
|
|
func TestNewCmd_helmInvalidVersion(t *testing.T) {
|
|
_, err := NewCmd(".", "abcd", "")
|
|
log.Println(err)
|
|
assert.EqualError(t, err, "helm chart version 'abcd' is not supported")
|
|
}
|
|
|
|
func TestNewCmd_withProxy(t *testing.T) {
|
|
cmd, err := NewCmd(".", "", "https://proxy:8888")
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, "https://proxy:8888", cmd.proxy)
|
|
}
|