diff --git a/Dockerfile b/Dockerfile index 5b38a0be..c695762d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/controllers/gitrepository_controller.go b/controllers/gitrepository_controller.go index f6bf1a6d..6b94d9d7 100644 --- a/controllers/gitrepository_controller.go +++ b/controllers/gitrepository_controller.go @@ -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 diff --git a/internal/git/checkout.go b/pkg/git/checkout.go similarity index 100% rename from internal/git/checkout.go rename to pkg/git/checkout.go diff --git a/internal/git/transport.go b/pkg/git/transport.go similarity index 100% rename from internal/git/transport.go rename to pkg/git/transport.go diff --git a/internal/git/transport_test.go b/pkg/git/transport_test.go similarity index 100% rename from internal/git/transport_test.go rename to pkg/git/transport_test.go