containers / containers/podlet

Support for :max-retries in restart

Open
#185 5 comments 0 reactions 0 assignees View on GitHub
blocked enhancement
Dominant language
Rust
Stars
1.6k
Forks
48
Avg merge
1d 9h
Merged PRs (30d)
1

Description

The docker-compose allows to set a a max-retries in the the restart configuration.

https://docs.docker.com/reference/compose-file/services/#restart

> `on-failure[:max-retries]`: The policy restarts the container if the exit code indicates an error. Optionally, limit the number of restart retries the Docker daemon attempts.

Having a compose file like:

```
services:
db:
image: docker.io/library/postgres:17
restart: on-failure:5
```

causes an error like this:
```
$ podlet compose container-compose.yml
Error:
0: error converting compose file
1: error reading compose file
2: File `container-compose.yml` is not a valid compose file
3: unknown variant `on-failure:5`, expected one of `no`, `always`, `on-failure`, `unless-stopped`

Location:
~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/podlet-0.3.1/src/cli/compose.rs:219
```

Would be nice to get support also in `potlet`, thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.