mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 01:38:43 +00:00
fix: prevent possible null pointer dereference error in TestAddHelmRepoInsecureSkipVerify test (#3650)
This commit is contained in:
parent
91d5d7e37b
commit
22dcc1e87d
1 changed files with 12 additions and 3 deletions
|
|
@ -121,15 +121,24 @@ func TestAddHelmRepoInsecureSkipVerify(t *testing.T) {
|
|||
"--insecure-skip-server-verification",
|
||||
"--tls-client-cert-path", repos.CertPath,
|
||||
"--tls-client-cert-key-path", repos.CertKeyPath)
|
||||
assert.NoError(t, err)
|
||||
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
|
||||
conn, repoClient, err := fixture.ArgoCDClientset.NewRepoClient()
|
||||
assert.NoError(t, err)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
|
||||
defer argoio.Close(conn)
|
||||
|
||||
repo, err := repoClient.List(context.Background(), &repositorypkg.RepoQuery{})
|
||||
|
||||
assert.NoError(t, err)
|
||||
if !assert.NoError(t, err) {
|
||||
return
|
||||
}
|
||||
|
||||
exists := false
|
||||
for i := range repo.Items {
|
||||
if repo.Items[i].Repo == fixture.RepoURL(fixture.RepoURLTypeHelm) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue