Skip to content

Commit c9c51f1

Browse files
authored
Merge pull request #96 from fluxcd/git-pkg
Make git package public
2 parents b8b0df2 + e65e2f0 commit c9c51f1

File tree

5 files changed

+4
-3
lines changed

5 files changed

+4
-3
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RUN go mod download
1313
COPY main.go main.go
1414
COPY api/ api/
1515
COPY controllers/ controllers/
16+
COPY pkg/ pkg/
1617
COPY internal/ internal/
1718

1819
# build

controllers/gitrepository_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import (
4040
"github.com/fluxcd/pkg/recorder"
4141

4242
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
43-
intgit "github.com/fluxcd/source-controller/internal/git"
43+
"github.com/fluxcd/source-controller/pkg/git"
4444
)
4545

4646
// GitRepositoryReconciler reconciles a GitRepository object
@@ -174,7 +174,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour
174174

175175
// determine auth method
176176
var auth transport.AuthMethod
177-
authStrategy := intgit.AuthSecretStrategyForURL(repository.Spec.URL)
177+
authStrategy := git.AuthSecretStrategyForURL(repository.Spec.URL)
178178
if repository.Spec.SecretRef != nil && authStrategy != nil {
179179
name := types.NamespacedName{
180180
Namespace: repository.GetNamespace(),
@@ -195,7 +195,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour
195195
}
196196
}
197197

198-
checkoutStrategy := intgit.CheckoutStrategyForRef(repository.Spec.Reference)
198+
checkoutStrategy := git.CheckoutStrategyForRef(repository.Spec.Reference)
199199
commit, revision, err := checkoutStrategy.Checkout(ctx, tmpGit, repository.Spec.URL, auth)
200200
if err != nil {
201201
return sourcev1.GitRepositoryNotReady(repository, sourcev1.GitOperationFailedReason, err.Error()), err

0 commit comments

Comments
 (0)