Skip to content

Commit

Permalink
git clone
Browse files Browse the repository at this point in the history
  • Loading branch information
zortax committed Aug 10, 2023
1 parent c5745c7 commit 693b84d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pulumi-operator-kubernetes-job/src/git/service.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::BTreeMap, path::PathBuf};
use std::{collections::BTreeMap, path::{PathBuf, Path}};

use git2::{Cred, RemoteCallbacks};
use git2::{Cred, RemoteCallbacks, FetchOptions, build::RepoBuilder};
use k8s_openapi::{api::core::v1::Secret, ByteString};
use kube::core::ObjectMeta;
use pulumi_operator_base::Inst;
Expand Down Expand Up @@ -81,6 +81,14 @@ impl GitService {
git_controller.build_callback(auth, &data, &mut callback)?;
}

let mut fo = FetchOptions::new();
fo.remote_callbacks(callback);

let mut builder = RepoBuilder::new();
builder.fetch_options(fo);

builder.clone("", Path::new(""));

Ok::<&str, GitError>("/")
}.await;
tx.send(res).expect("Failed to communicate between threads.");
Expand Down

0 comments on commit 693b84d

Please sign in to comment.