Skip to content

Commit

Permalink
add secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
grant0417 committed Apr 20, 2023
1 parent beebacd commit 49a1b8b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ impl Client {
.map(Response::into_inner)
}

pub async fn session(&mut self) -> Result<(), tonic::Status> {
self.0.session(Request::new(())).await.map(|_| ()
}
// pub async fn session(&mut self) -> Result<(), tonic::Status> {
// self.0.session(Request::new(())).await.map(|_| ()
// }
}

trait BuildkitRequestBuilder<T> {
Expand Down
13 changes: 10 additions & 3 deletions crates/proto/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::io::Result;
use std::{io::Result, path::PathBuf};

const VENDOR_DIR: &str = "vendor";
const BUILDKIT_DIR: &str = "vendor/github.com/moby/buildkit";
Expand All @@ -9,14 +9,21 @@ fn main() -> Result<()> {
let protos = [
format!("{BUILDKIT_DIR}/frontend/gateway/pb/gateway.proto"),
format!("{BUILDKIT_DIR}/api/services/control/control.proto"),
format!("{BUILDKIT_DIR}/session/auth/auth.proto"),
format!("{BUILDKIT_DIR}/session/secrets/secrets.proto"),
];
let includes = [VENDOR_DIR.into(), format!("{BUILDKIT_DIR}/vendor")];

tonic_build::configure()
.build_server(false)
.compile(&protos, &includes)?;

let protos = [
format!("{BUILDKIT_DIR}/session/secrets/secrets.proto"),
format!("{BUILDKIT_DIR}/session/auth/auth.proto"),
];

tonic_build::configure()
.build_client(false)
.compile(&protos, &includes)?;

Ok(())
}
6 changes: 6 additions & 0 deletions crates/proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ pub mod moby {
include!(concat!(env!("OUT_DIR"), "/moby.buildkit.v1.types.rs"));
}
}

pub mod secrets {
pub mod v1 {
include!(concat!(env!("OUT_DIR"), "/moby.buildkit.secrets.v1.rs"));
}
}
}

pub mod filesync {
Expand Down

0 comments on commit 49a1b8b

Please sign in to comment.