From 57c820ac8f94654295885d95bdb23b537c14addd Mon Sep 17 00:00:00 2001 From: Yash Sethiya Date: Thu, 25 Jan 2024 15:56:51 +0530 Subject: [PATCH] Added more testcases Signed-off-by: Yash Sethiya --- pkg/fetch/vendir_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/fetch/vendir_test.go b/pkg/fetch/vendir_test.go index 5a37efc921..961a1cb2a7 100644 --- a/pkg/fetch/vendir_test.go +++ b/pkg/fetch/vendir_test.go @@ -65,7 +65,7 @@ func Test_GitURL_skipsTLS(t *testing.T) { Namespace: "default", }, Data: map[string]string{ - "dangerousSkipTLSVerify": "github.com, gitlab.com, hostname.com", + "dangerousSkipTLSVerify": "github.com, gitlab.com, hostname.com, 0.0.0.0", }, } k8scs := k8sfake.NewSimpleClientset(configMap) @@ -84,6 +84,7 @@ func Test_GitURL_skipsTLS(t *testing.T) { {"https://gitlab.com/bitnami/charts/", true}, {"ssh://username@hostname.com:/path/to/repo.git", true}, {"https://bitbucket.org/bitnami/charts/", false}, + {"https://0.0.0.0/bitnami/charts/", true}, } for i, tc := range testCases { err = vendir.AddDir(v1alpha1.AppFetch{ @@ -93,6 +94,8 @@ func Test_GitURL_skipsTLS(t *testing.T) { assert.NoError(t, err) vConf := vendir.Config() + t.Logf("%+v", vConf) + t.Logf("%+v", vConf.Directories[i].Contents[0].Git) assert.Equal(t, i+1, len(vConf.Directories), "Failed on iteration %d", i) assert.Equal(t, tc.shouldSkipTLS, vConf.Directories[i].Contents[0].Git.DangerousSkipTLSVerify, "Failed with URL %s", tc.URL) }