commit
c9c51f113a
|
@ -13,6 +13,7 @@ RUN go mod download
|
||||||
COPY main.go main.go
|
COPY main.go main.go
|
||||||
COPY api/ api/
|
COPY api/ api/
|
||||||
COPY controllers/ controllers/
|
COPY controllers/ controllers/
|
||||||
|
COPY pkg/ pkg/
|
||||||
COPY internal/ internal/
|
COPY internal/ internal/
|
||||||
|
|
||||||
# build
|
# build
|
||||||
|
|
|
@ -40,7 +40,7 @@ import (
|
||||||
"github.com/fluxcd/pkg/recorder"
|
"github.com/fluxcd/pkg/recorder"
|
||||||
|
|
||||||
sourcev1 "github.com/fluxcd/source-controller/api/v1alpha1"
|
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
|
// GitRepositoryReconciler reconciles a GitRepository object
|
||||||
|
@ -174,7 +174,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour
|
||||||
|
|
||||||
// determine auth method
|
// determine auth method
|
||||||
var auth transport.AuthMethod
|
var auth transport.AuthMethod
|
||||||
authStrategy := intgit.AuthSecretStrategyForURL(repository.Spec.URL)
|
authStrategy := git.AuthSecretStrategyForURL(repository.Spec.URL)
|
||||||
if repository.Spec.SecretRef != nil && authStrategy != nil {
|
if repository.Spec.SecretRef != nil && authStrategy != nil {
|
||||||
name := types.NamespacedName{
|
name := types.NamespacedName{
|
||||||
Namespace: repository.GetNamespace(),
|
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)
|
commit, revision, err := checkoutStrategy.Checkout(ctx, tmpGit, repository.Spec.URL, auth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return sourcev1.GitRepositoryNotReady(repository, sourcev1.GitOperationFailedReason, err.Error()), err
|
return sourcev1.GitRepositoryNotReady(repository, sourcev1.GitOperationFailedReason, err.Error()), err
|
||||||
|
|
Loading…
Reference in New Issue