Skip to content

Commit d048730

Browse files
committed
git/ssh: use in-memory known hosts database
1 parent 48fcc52 commit d048730

File tree

6 files changed

+789
-41
lines changed

6 files changed

+789
-41
lines changed

controllers/gitrepository_controller.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,11 @@ func (r *GitRepositoryReconciler) sync(ctx context.Context, repository sourcev1.
163163
return sourcev1.GitRepositoryNotReady(repository, sourcev1.AuthenticationFailedReason, err.Error()), err
164164
}
165165

166-
method, cleanup, err := intgit.AuthMethodFromSecret(repository.Spec.URL, secret)
166+
method, err := intgit.AuthMethodFromSecret(repository.Spec.URL, secret)
167167
if err != nil {
168168
err = fmt.Errorf("auth error: %w", err)
169169
return sourcev1.GitRepositoryNotReady(repository, sourcev1.AuthenticationFailedReason, err.Error()), err
170170
}
171-
if cleanup != nil {
172-
defer cleanup()
173-
}
174171
auth = method
175172
}
176173

@@ -292,7 +289,7 @@ func (r *GitRepositoryReconciler) sync(ctx context.Context, repository sourcev1.
292289
if repository.Spec.Verification != nil {
293290
err := r.verify(ctx, types.NamespacedName{
294291
Namespace: repository.Namespace,
295-
Name: repository.Spec.Verification.SecretRef.Name,
292+
Name: repository.Spec.Verification.SecretRef.Name,
296293
}, commit)
297294
if err != nil {
298295
return sourcev1.GitRepositoryNotReady(repository, sourcev1.VerificationFailedReason, err.Error()), err

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/go-logr/logr v0.1.0
99
github.com/onsi/ginkgo v1.11.0
1010
github.com/onsi/gomega v1.8.1
11-
github.com/pkg/errors v0.9.1
11+
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
1212
helm.sh/helm/v3 v3.1.2
1313
k8s.io/api v0.17.2
1414
k8s.io/apimachinery v0.17.2

0 commit comments

Comments
 (0)