Merge pull request #96 from fluxcd/git-pkg

Make git package public
This commit is contained in:
Stefan Prodan 2020-07-20 13:22:13 +03:00 committed by GitHub
commit c9c51f113a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 3 deletions

View File

@ -13,6 +13,7 @@ RUN go mod download
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY pkg/ pkg/
COPY internal/ internal/
# build

View File

@ -40,7 +40,7 @@ import (
"github.com/fluxcd/pkg/recorder"
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
intgit "github.com/fluxcd/source-controller/internal/git"
"github.com/fluxcd/source-controller/pkg/git"
)
// GitRepositoryReconciler reconciles a GitRepository object
@ -174,7 +174,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour
// determine auth method
var auth transport.AuthMethod
authStrategy := intgit.AuthSecretStrategyForURL(repository.Spec.URL)
authStrategy := git.AuthSecretStrategyForURL(repository.Spec.URL)
if repository.Spec.SecretRef != nil && authStrategy != nil {
name := types.NamespacedName{
Namespace: repository.GetNamespace(),
@ -195,7 +195,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour
}
}
checkoutStrategy := intgit.CheckoutStrategyForRef(repository.Spec.Reference)
checkoutStrategy := git.CheckoutStrategyForRef(repository.Spec.Reference)
commit, revision, err := checkoutStrategy.Checkout(ctx, tmpGit, repository.Spec.URL, auth)
if err != nil {
return sourcev1.GitRepositoryNotReady(repository, sourcev1.GitOperationFailedReason, err.Error()), err