Describe the bug
sablier.enable=true labels are checked during discovery (InstanceList, InstanceGroups), but the operational methods — InstanceStart, InstanceStop, and NotifyInstanceStopped — do not validate whether the target instance has the management label.
Was this the intended behavior when the label system was introduced in #134 ? It seems like the label was meant to define which instances Sablier manages, but the enforcement is only partial — discovery respects it, while operations do not.
This means:
- Any container can be started/stopped by name through the Sablier API, even if it was never intended to be managed by Sablier
- Session expiry stops unlabeled containers —
OnInstanceExpired calls InstanceStop without any label check, so a container started via Sablier API (even without the label) will be stopped when the session expires.
NotifyInstanceStopped watches all containers — Docker/Podman listen to all die events, Kubernetes informers watch all deployments/statefulsets, regardless of labels.
Context
- Sablier version: <= 1.11.2
- Provider: all
- Reverse proxy: N/A
- Sablier running inside a container? No
Expected behavior
InstanceStart / InstanceStop should return an error when the target instance does not have the management label.
NotifyInstanceStopped should only report events for managed (labeled) instances.
- Session expiry should gracefully handle the case where a container is not managed.
Additional context
- I ran into a case with Caddy wildcard setup where an unlabeled container that was already running got stopped when a session expired. It wasn't meant to be managed by Sablier at all.
Describe the bug
sablier.enable=truelabels are checked during discovery (InstanceList,InstanceGroups), but the operational methods —InstanceStart,InstanceStop, andNotifyInstanceStopped— do not validate whether the target instance has the management label.Was this the intended behavior when the label system was introduced in #134 ? It seems like the label was meant to define which instances Sablier manages, but the enforcement is only partial — discovery respects it, while operations do not.
This means:
OnInstanceExpiredcallsInstanceStopwithout any label check, so a container started via Sablier API (even without the label) will be stopped when the session expires.NotifyInstanceStoppedwatches all containers — Docker/Podman listen to alldieevents, Kubernetes informers watch all deployments/statefulsets, regardless of labels.Context
Expected behavior
InstanceStart/InstanceStopshould return an error when the target instance does not have the management label.NotifyInstanceStoppedshould only report events for managed (labeled) instances.Additional context