Skip to content

Commit

Permalink
prevent erroring in case of missing entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
rawdaGastan committed Oct 20, 2024
1 parent 674ca75 commit c38b0f8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions docker2fl/src/docker2fl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,13 @@ async fn container_boot(

let cmd = container_config.cmd.expect("failed to get cmd configs");

if container_config.entrypoint.is_some() {
let entrypoint = container_config
.entrypoint
.expect("failed to get entry point");
command = (entrypoint.first().expect("failed to get first entry point")).to_string();
if let Some(entrypoint) = container_config.entrypoint {
command = (entrypoint.first().expect("failed to get first entrypoint")).to_string();

if entrypoint.len() > 1 {
let (_, entries) = entrypoint
.split_first()
.expect("failed to split entry point");
.expect("failed to split entrypoint");
args = entries.to_vec();
} else {
args = cmd;
Expand Down

0 comments on commit c38b0f8

Please sign in to comment.