Skip to content

Commit 82a6a69

Browse files
committed
Address review comments
1 parent 7ec1e60 commit 82a6a69

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

e2e/single-cluster/go_getter_custom_ca_test.go

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ import (
2121
"sigs.k8s.io/yaml"
2222
)
2323

24+
// Those tests are specifically targeting one feature of go-getter, namely cloning of git
25+
// repositories using HTTPS. That is, because TLS certificates are only used in HTTPS URLs, not if
26+
// SSH keys are used to clone those repositories. Since go-getter shells out to the `git` CLI for
27+
// cloning git repositories, the configuration of TLS certificates or ignoring those needs to be
28+
// configured with `git` typical environment variables. Those are the tests for that implementation.
29+
// For go-getter to be used, the `helm.chart` field in `fleet.yaml` needs to point to a URL that
30+
// tells go-getter to use the git protocol over HTTPS. Such an URL is prefixed with `git::https://`.
31+
// The contents fetched from those repositories are expected to be helm charts.
2432
var _ = Describe("Testing go-getter CA bundles and insecureSkipVerify for cloning git repositories", Label("infra-setup"), func() {
2533
const (
2634
sleeper = "sleeper"
@@ -150,7 +158,7 @@ var _ = Describe("Testing go-getter CA bundles and insecureSkipVerify for clonin
150158
Expect(err).ToNot(HaveOccurred())
151159
cloneDir = path.Join(tmpDir, "repo") // Fixed and built into the container image.
152160
gitrepoName = testenv.RandomFilename("gitjob-test", r)
153-
// Creates the content in the sleeperClusterName directory
161+
// Creates the content in the sleeper directory
154162
_, err = gh.Create(cloneDir, testenv.AssetPath("gitrepo/sleeper-chart"), sleeper)
155163
Expect(err).ToNot(HaveOccurred())
156164

@@ -257,21 +265,6 @@ var _ = Describe("Testing go-getter CA bundles and insecureSkipVerify for clonin
257265
createGitRepo(gitRepoOptions{HelmSecretNameForPaths: secretName})
258266
Consistently(expectGitRepoToNotBeReady).Should(Succeed())
259267
})
260-
261-
It("should succeed when using a correct CA bundle provided in helmSecretNameForPath", func() {
262-
secretName := "helm-ca-bundle-by-path-" + gitrepoName
263-
createHelmSecretForPaths(
264-
secretName,
265-
AuthConfigByPath{
266-
entrypoint: {
267-
CABundle: mustReadFileAsBase64(getCertificateFilePath()),
268-
},
269-
},
270-
)
271-
272-
createGitRepo(gitRepoOptions{HelmSecretNameForPaths: secretName})
273-
Eventually(expectGitRepoToBeReady).Should(Succeed())
274-
})
275268
})
276269

277270
When("testing ignoring insecure certificates for cloning git repositories with HTTPS using go-getter (fleet.yaml)", func() {

e2e/testenv/githelper/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (g *Git) Create(repodir string, from string, subdir string) (*git.Repositor
190190
return nil, err
191191
}
192192

193-
err = copy.Copy(from, path.Join(repodir, subdir)) //nolint:gosec // test code should never receive user input
193+
err = copy.Copy(from, path.Join(repodir, subdir))
194194
if err != nil {
195195
return nil, err
196196
}

0 commit comments

Comments
 (0)