Skip to content

Commit 92603f3

Browse files
author
Paulo Gomes
authored
Merge pull request #459 from aryan9600/bump-git-v0.7.0
bump pkg/git, pkg/git/gogit and pkg/git/libgit2
2 parents 1b8d307 + 1cacafa commit 92603f3

File tree

3 files changed

+67
-51
lines changed

3 files changed

+67
-51
lines changed

controllers/imageupdateautomation_controller.go

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import (
5353
"github.com/fluxcd/pkg/git"
5454
"github.com/fluxcd/pkg/git/gogit"
5555
"github.com/fluxcd/pkg/git/libgit2"
56+
"github.com/fluxcd/pkg/git/repository"
5657
"github.com/fluxcd/pkg/runtime/acl"
5758
helper "github.com/fluxcd/pkg/runtime/controller"
5859
"github.com/fluxcd/pkg/runtime/logger"
@@ -262,18 +263,25 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
262263
gitImplementation = sourcev1.GoGitImplementation
263264
}
264265

265-
var gitClient git.RepositoryClient
266+
var gitClient repository.Client
266267
switch gitImplementation {
267268
case sourcev1.LibGit2Implementation:
268-
gitClient, err = libgit2.NewClient(tmp, authOpts)
269+
clientOpts := []libgit2.ClientOption{libgit2.WithDiskStorage()}
270+
if authOpts.Transport == git.HTTP {
271+
clientOpts = append(clientOpts, libgit2.WithInsecureCredentialsOverHTTP())
272+
}
273+
gitClient, err = libgit2.NewClient(tmp, authOpts, clientOpts...)
269274
case sourcev1.GoGitImplementation, "":
270-
opts := make([]gogit.ClientOption, 0)
275+
clientOpts := []gogit.ClientOption{gogit.WithDiskStorage()}
271276
forcePush, _ := features.Enabled(features.GitForcePushBranch)
272277
if forcePush && pushBranch != ref.Branch {
273-
opts = append(opts, gogit.WithDiskStorage, gogit.WithForcePush())
278+
clientOpts = append(clientOpts, gogit.WithForcePush())
279+
}
280+
if authOpts.Transport == git.HTTP {
281+
clientOpts = append(clientOpts, gogit.WithInsecureCredentialsOverHTTP())
274282
}
275283

276-
gitClient, err = gogit.NewClient(tmp, authOpts, opts...)
284+
gitClient, err = gogit.NewClient(tmp, authOpts, clientOpts...)
277285
default:
278286
err = fmt.Errorf("failed to create git client; referred GitRepository has invalid implementation: %s", gitImplementation)
279287
}
@@ -282,7 +290,7 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
282290
}
283291
defer gitClient.Close()
284292

285-
opts := git.CloneOptions{}
293+
opts := repository.CloneOptions{}
286294
if ref != nil {
287295
opts.Tag = ref.Tag
288296
opts.SemVer = ref.SemVer
@@ -376,7 +384,7 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
376384
},
377385
Message: message,
378386
},
379-
git.WithSigner(signingEntity),
387+
repository.WithSigner(signingEntity),
380388
); err != nil {
381389
if err != git.ErrNoStagedFiles {
382390
return failWithError(err)

go.mod

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ require (
3030
github.com/fluxcd/pkg/apis/acl v0.1.0
3131
github.com/fluxcd/pkg/apis/event v0.1.0
3232
github.com/fluxcd/pkg/apis/meta v0.17.0
33-
github.com/fluxcd/pkg/git v0.6.1
34-
github.com/fluxcd/pkg/git/gogit v0.0.0-20221102123958-2ee90dd5b2ec
35-
github.com/fluxcd/pkg/git/libgit2 v0.0.0-20221102123958-2ee90dd5b2ec
36-
github.com/fluxcd/pkg/gittestserver v0.7.0
33+
github.com/fluxcd/pkg/git v0.7.0
34+
github.com/fluxcd/pkg/git/gogit v0.2.0
35+
github.com/fluxcd/pkg/git/libgit2 v0.3.0
36+
github.com/fluxcd/pkg/gittestserver v0.8.0
3737
github.com/fluxcd/pkg/runtime v0.23.0
38-
github.com/fluxcd/pkg/ssh v0.6.0
38+
github.com/fluxcd/pkg/ssh v0.7.0
3939
github.com/fluxcd/source-controller/api v0.31.0
4040
github.com/go-git/go-billy/v5 v5.3.1
4141
github.com/go-git/go-git/v5 v5.4.2
4242
github.com/go-logr/logr v1.2.3
4343
github.com/google/go-containerregistry v0.12.0
4444
github.com/libgit2/git2go/v34 v34.0.0
45-
github.com/onsi/gomega v1.24.0
45+
github.com/onsi/gomega v1.24.1
4646
github.com/otiai10/copy v1.9.0
4747
github.com/spf13/pflag v1.0.5
48-
golang.org/x/crypto v0.1.0
48+
golang.org/x/crypto v0.2.0
4949
k8s.io/api v0.25.3
50-
k8s.io/apimachinery v0.25.3
50+
k8s.io/apimachinery v0.25.4
5151
k8s.io/client-go v0.25.3
5252
k8s.io/kube-openapi v0.0.0-20221106113015-f73e7dbcfe29
5353
sigs.k8s.io/controller-runtime v0.13.1
@@ -72,7 +72,7 @@ require (
7272
github.com/beorn7/perks v1.0.1 // indirect
7373
github.com/cespare/xxhash/v2 v2.1.2 // indirect
7474
github.com/chai2010/gettext-go v1.0.2 // indirect
75-
github.com/cloudflare/circl v1.2.0 // indirect
75+
github.com/cloudflare/circl v1.3.0 // indirect
7676
github.com/davecgh/go-spew v1.1.1 // indirect
7777
github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 // indirect
7878
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
@@ -81,8 +81,8 @@ require (
8181
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
8282
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
8383
github.com/fluxcd/gitkit v0.6.0 // indirect
84-
github.com/fluxcd/pkg/gitutil v0.2.0 // indirect
85-
github.com/fluxcd/pkg/http/transport v0.0.1 // indirect
84+
github.com/fluxcd/go-git/v5 v5.0.0-20221104190732-329fd6659b10 // indirect
85+
github.com/fluxcd/pkg/http/transport v0.1.0 // indirect
8686
github.com/fluxcd/pkg/version v0.2.0 // indirect
8787
github.com/fsnotify/fsnotify v1.5.4 // indirect
8888
github.com/go-errors/errors v1.0.1 // indirect
@@ -149,10 +149,10 @@ require (
149149
go.uber.org/multierr v1.8.0 // indirect
150150
go.uber.org/zap v1.23.0 // indirect
151151
golang.org/x/mod v0.6.0 // indirect
152-
golang.org/x/net v0.1.0 // indirect
152+
golang.org/x/net v0.2.0 // indirect
153153
golang.org/x/oauth2 v0.1.0 // indirect
154-
golang.org/x/sys v0.1.0 // indirect
155-
golang.org/x/term v0.1.0 // indirect
154+
golang.org/x/sys v0.2.0 // indirect
155+
golang.org/x/term v0.2.0 // indirect
156156
golang.org/x/text v0.4.0 // indirect
157157
golang.org/x/time v0.1.0 // indirect
158158
golang.org/x/tools v0.2.0 // indirect

0 commit comments

Comments
 (0)