Verify enabled on expiration
Inspect an instance before stopping it when its session expires, and skip the stop if it is not labelled sablier.enable=true.
# compose.yml
services:
sablier:
image: sablierapp/sablier:next
command:
- start
- --provider.name=docker
- --provider.verify-enabled-on-expiration=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
unlabeled:
image: acouvreur/whoami:v1.10.2When the session for the unlabeled container expires, Sablier inspects it, finds no sablier.enable=true label, and leaves it running.
With --provider.verify-enabled-on-expiration=true, Sablier inspects an instance before stopping it when its session expires, and skips the stop if the instance is not labelled sablier.enable=true. This protects containers that are no longer (or were never) Sablier-managed from being stopped when an old session expires.
When to use it
Use this when a session may outlive a container’s Sablier labels, for example if a container is redeployed without the label, and you want to be sure Sablier never stops something it does not currently manage.
Flags
--provider.verify-enabled-on-expiration: inspect an instance on session expiration and only stop it if it is still labelledsablier.enable=true.
See the runnable example.