Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ If a compose file is not given, Podlet will search for the following files in th
- `compose.yml`
- `docker-compose.yaml`
- `docker-compose.yml`
- `podman-compose.yaml`
- `podman-compose.yml`


#### Pod
Expand Down
14 changes: 9 additions & 5 deletions src/cli/compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct Compose {
/// the compose file will be read from stdin.
///
/// If not provided, and stdin is a terminal, Podlet will look for (in order)
/// `compose.yaml`, `compose.yml`, `docker-compose.yaml`, and `docker-compose.yml`,
/// `compose.yaml`, `compose.yml`, `docker-compose.yaml`, and `docker-compose.yml`, `podman-compose.yaml`, and `podman-compose.yml`,
/// in the current working directory.
#[allow(clippy::struct_field_names)]
pub compose_file: Option<PathBuf>,
Expand Down Expand Up @@ -160,7 +160,8 @@ impl Compose {
///
/// If the path is '-', or stdin is not a terminal, the compose file is deserialized from stdin.
/// If a path is not provided, the files `compose.yaml`, `compose.yml`, `docker-compose.yaml`,
/// and `docker-compose.yml` are, in order, looked for in the current directory.
/// `docker-compose.yml`, `podman-compose.yaml`, and `podman-compose.yml` are, in order, looked for
/// in the current directory.
///
/// # Errors
///
Expand All @@ -183,11 +184,13 @@ fn read_from_file_or_stdin(
.suggestion("make sure you have the proper permissions for the given file")?;
(compose_file, path)
} else {
const FILE_NAMES: [&str; 4] = [
const FILE_NAMES: [&str; 6] = [
"compose.yaml",
"compose.yml",
"docker-compose.yaml",
"docker-compose.yml",
"podman-compose.yaml",
"podman-compose.yml",
];

if !io::stdin().is_terminal() {
Expand All @@ -204,8 +207,9 @@ fn read_from_file_or_stdin(

result.ok_or_eyre(
"a compose file was not provided and none of \
`compose.yaml`, `compose.yml`, `docker-compose.yaml`, or `docker-compose.yml` \
exist in the current directory or could not be read",
`compose.yaml`, `compose.yml`, `docker-compose.yaml`, `docker-compose.yml`, \
`podman-compose.yaml`, or `podman-compose.yml` exist in the current directory or \
could not be read",
)?
};

Expand Down