Skip to content

Commit

Permalink
Merge pull request #7 from DominicBurkart/str-to-string
Browse files Browse the repository at this point in the history
update type signature for DeployContainerFunction
  • Loading branch information
DominicBurkart authored Jun 19, 2021
2 parents 55befc0 + c95f8e6 commit 03b7538
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/kubernetes_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ lazy_static! {
/// a function that is called after the container is
/// built, so that the container may be added to a
/// specific registry or otherwise be made available.
fn load_container_into_kind(tag: &str) -> anyhow::Result<&str> {
fn load_container_into_kind(tag: String) -> anyhow::Result<String> {
std::process::Command::new("kind")
.args(format!("load docker-image {}", tag).as_str().split(' '))
.status()?;
Expand Down
4 changes: 2 additions & 2 deletions turbolift_internals/src/kubernetes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::CACHE_PATH;

const TURBOLIFT_K8S_NAMESPACE: &str = "default";
type ImageTag = String;
type DeployContainerFunction = Box<dyn Fn(&str) -> anyhow::Result<&str> + Send + 'static>;
type DeployContainerFunction = Box<dyn Fn(String) -> anyhow::Result<String> + Send + 'static>;

pub const CONTAINER_PORT: i32 = 5678;
pub const SERVICE_PORT: i32 = 5678;
Expand Down Expand Up @@ -390,7 +390,7 @@ CMD [\"./{function_name}\", \"0.0.0.0:{container_port}\"]",
// always remove the build directory, even on build error
std::fs::remove_dir_all(build_dir_canonical)?;

result.and((k8s.deploy_container)(unique_tag.as_str()).map(|s| s.to_string()))
result.and((k8s.deploy_container)(unique_tag))
}

impl Drop for K8s {
Expand Down

0 comments on commit 03b7538

Please sign in to comment.