Skip to content

Commit 3475d74

Browse files
committed
Switch to dedicated git and helm testserver pkgs
1 parent 9d947b8 commit 3475d74

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

controllers/gitrepository_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3939
"k8s.io/apimachinery/pkg/types"
4040

41-
"github.com/fluxcd/pkg/testserver"
41+
"github.com/fluxcd/pkg/gittestserver"
4242

4343
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
4444
)
@@ -54,7 +54,7 @@ var _ = Describe("GitRepositoryReconciler", func() {
5454
Context("GitRepository", func() {
5555
var (
5656
namespace *corev1.Namespace
57-
gitServer *testserver.GitServer
57+
gitServer *gittestserver.GitServer
5858
err error
5959
)
6060

@@ -65,7 +65,7 @@ var _ = Describe("GitRepositoryReconciler", func() {
6565
err = k8sClient.Create(context.Background(), namespace)
6666
Expect(err).NotTo(HaveOccurred(), "failed to create test namespace")
6767

68-
gitServer, err = testserver.NewTempGitServer()
68+
gitServer, err = gittestserver.NewTempGitServer()
6969
Expect(err).NotTo(HaveOccurred())
7070
gitServer.AutoCreate()
7171
})

controllers/helmchart_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3131
"k8s.io/apimachinery/pkg/types"
3232

33-
"github.com/fluxcd/pkg/testserver"
33+
"github.com/fluxcd/pkg/helmtestserver"
3434

3535
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
3636
)
@@ -47,7 +47,7 @@ var _ = Describe("HelmChartReconciler", func() {
4747
Context("HelmChart", func() {
4848
var (
4949
namespace *corev1.Namespace
50-
helmServer *testserver.HelmServer
50+
helmServer *helmtestserver.HelmServer
5151
err error
5252
)
5353

@@ -58,7 +58,7 @@ var _ = Describe("HelmChartReconciler", func() {
5858
err = k8sClient.Create(context.Background(), namespace)
5959
Expect(err).NotTo(HaveOccurred(), "failed to create test namespace")
6060

61-
helmServer, err = testserver.NewTempHelmServer()
61+
helmServer, err = helmtestserver.NewTempHelmServer()
6262
Expect(err).To(Succeed())
6363
helmServer.Start()
6464
})

controllers/helmrepository_controller_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3131
"k8s.io/apimachinery/pkg/types"
3232

33-
"github.com/fluxcd/pkg/testserver"
33+
"github.com/fluxcd/pkg/helmtestserver"
3434

3535
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
3636
)
@@ -47,7 +47,7 @@ var _ = Describe("HelmRepositoryReconciler", func() {
4747
Context("HelmRepository", func() {
4848
var (
4949
namespace *corev1.Namespace
50-
helmServer *testserver.HelmServer
50+
helmServer *helmtestserver.HelmServer
5151
err error
5252
)
5353

@@ -58,7 +58,7 @@ var _ = Describe("HelmRepositoryReconciler", func() {
5858
err = k8sClient.Create(context.Background(), namespace)
5959
Expect(err).NotTo(HaveOccurred(), "failed to create test namespace")
6060

61-
helmServer, err = testserver.NewTempHelmServer()
61+
helmServer, err = helmtestserver.NewTempHelmServer()
6262
Expect(err).To(Succeed())
6363
})
6464

@@ -205,7 +205,7 @@ var _ = Describe("HelmRepositoryReconciler", func() {
205205
})
206206

207207
It("Authenticates when basic auth credentials are provided", func() {
208-
helmServer, err = testserver.NewTempHelmServer()
208+
helmServer, err = helmtestserver.NewTempHelmServer()
209209
Expect(err).NotTo(HaveOccurred())
210210

211211
var username, password = "john", "doe"
@@ -311,7 +311,7 @@ var _ = Describe("HelmRepositoryReconciler", func() {
311311
})
312312

313313
It("Authenticates when TLS credentials are provided", func() {
314-
err = helmServer.StartTLS(examplePublicKey, examplePrivateKey, exampleCA)
314+
err = helmServer.StartTLS(examplePublicKey, examplePrivateKey, exampleCA, "example.com")
315315
Expect(err).NotTo(HaveOccurred())
316316

317317
Expect(helmServer.PackageChart(path.Join("testdata/helmchart"))).Should(Succeed())

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ replace github.com/fluxcd/source-controller/api => ./api
66

77
require (
88
github.com/blang/semver v3.5.0+incompatible
9+
github.com/fluxcd/pkg/gittestserver v0.0.1
10+
github.com/fluxcd/pkg/helmtestserver v0.0.1
911
github.com/fluxcd/pkg/lockedfile v0.0.5
1012
github.com/fluxcd/pkg/recorder v0.0.5
1113
github.com/fluxcd/pkg/ssh v0.0.5
12-
github.com/fluxcd/pkg/testserver v0.0.1
1314
github.com/fluxcd/source-controller/api v0.0.0-00010101000000-000000000000
1415
github.com/go-git/go-billy/v5 v5.0.0
1516
github.com/go-git/go-git/v5 v5.1.0

go.sum

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,18 @@ github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZM
199199
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
200200
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
201201
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
202+
github.com/fluxcd/pkg/gittestserver v0.0.1 h1:2jGRV1pFlycrOiLmXc99s5iCFRgHIfygYR7QVe4KXYY=
203+
github.com/fluxcd/pkg/gittestserver v0.0.1/go.mod h1:cGNJIdH3y9cE8YkPXx9PQfzZFBndibc4ZqrHc5Tq4xo=
204+
github.com/fluxcd/pkg/helmtestserver v0.0.1 h1:8RcLZdg7Zr9ZqyijsIIASjjMXQtF4UWP4Uds4iK2VJM=
205+
github.com/fluxcd/pkg/helmtestserver v0.0.1/go.mod h1:GR8LriiU7PqZSTH4Xe6Cimpig2VVPB29PeUXJjNJYfA=
202206
github.com/fluxcd/pkg/lockedfile v0.0.5 h1:C3T8wfdff1UY1bvplmCkGOLrdMWJHO8Q8+tdlEXJYzQ=
203207
github.com/fluxcd/pkg/lockedfile v0.0.5/go.mod h1:uAtPUBId6a2RqO84MTH5HKGX0SbM1kNW3Wr/FhYyDVA=
204208
github.com/fluxcd/pkg/recorder v0.0.5 h1:D8qfupahIvh6ncCMn2yTHsrzG91S05sp4zdpsbKWeaU=
205209
github.com/fluxcd/pkg/recorder v0.0.5/go.mod h1:2UG6EroZ6ZbqmqoL8k/cQMe09e6A36WyH4t4UDUGyuU=
206210
github.com/fluxcd/pkg/ssh v0.0.5 h1:rnbFZ7voy2JBlUfMbfyqArX2FYaLNpDhccGFC3qW83A=
207211
github.com/fluxcd/pkg/ssh v0.0.5/go.mod h1:7jXPdXZpc0ttMNz2kD9QuMi3RNn/e0DOFbj0Tij/+Hs=
208-
github.com/fluxcd/pkg/testserver v0.0.1 h1:fZFDZ1GCo4yoN+t8vlaqBfyFRv8PtbwMMJYpguVRz/Y=
209-
github.com/fluxcd/pkg/testserver v0.0.1/go.mod h1:n+13cVubIdlFFkjqwdz7ZIdII3/08IiizWzSsKajANM=
212+
github.com/fluxcd/pkg/testserver v0.0.2 h1:SoaMtO9cE5p/wl2zkGudzflnEHd9mk68CGjZOo7w0Uk=
213+
github.com/fluxcd/pkg/testserver v0.0.2/go.mod h1:pgUZTh9aQ44FSTQo+5NFlh7YMbUfdz1B80DalW7k96Y=
210214
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
211215
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
212216
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
@@ -769,8 +773,9 @@ golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPh
769773
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
770774
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
771775
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
772-
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
773776
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
777+
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig=
778+
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
774779
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
775780
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
776781
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=

0 commit comments

Comments
 (0)