For some yet unknown reasons, some instances are returned as nil.
This commits adds a nil check to prevent that and logs a warning to help further debugging.
Fixes#380
When an instance does not exist yet and needs to be started, its status is not assumed to be starting anymore.
Instead, the statue will be retrieved from the provider. This changes one thing, it's that you may be able to start and access your services instantly because they'll be instantly seen as ready.
With this change, you might want to make sure that your containers have a proper healthcheck used to determine when the application is able to process incoming requests.
* refactor: add interface guards
* refactor(providers): remove instance.State as a return value from Stop and Start
* test(e2e): add healthcheck on nginx container
Because now the container check is so fast, we need to add a delay on which the container is considered started and healthy to have a proper waiting page.
* fix(tests): using acouvreur/whoami:v1.10.2 instead of containous/whoami:v1.5.0
This image simply retrieve the curl binary from curlimages/curl:8.8.0 to be able to add proper docker healthcheck commands.
Once this is merged with traefik/whoami, I'll update back to the original image.
See https://github.com/traefik/whoami/issues/33
This feature adds the capability to stop unregistered running instances upon startup.
Previously, you had to stop running instances manually or issue an initial request that will shut down instances afterwards.
With this change, all discovered instances will be shutdown. They need to be registered using labels. E.g.: sablier.enable=true
Fixes#153
The `docker` and `docker_swarm` providers have been patched to ensure that the connection is properly established upon starting.
If the docker host is not available at starting time, then the application will stop. This will prevent from trying to register to the event stream on a non working client.
The Content-Length header will help system work better with long payloads.
The ngx_wasm_module from kong is not able to read the whole request without this header.
Currently the documentation states that `docker_swarm` is an acceptable value for the Docker Swarm provider.
However, the code actually uses `swarm`.
This changes adds `docker_swarm` as a supported provider alias for docker swarm.
Closes#279
the delimiter configuration property for kubernetes allows you to change the default "_" delimiter.
By specifying "/" or "." as a delimiter you ensure that you won't collide with objects names that contains the default delimiter "_".
Fixes#207
fixes vet like "app/providers/mocks/client_mock.go:314:9: Get passes lock by value: github.com/acouvreur/sablier/app/providers/mocks.DeploymentMock contains github.com/stretchr/testify/mock.Mock contains sync.Mutex"
If a deployment or a statefulset is scaled to 0, then it is removed from the store.
In order for this to work, you need the `list` and `watch` verbs in your ClusterRole
This could bring too much complexity. If a new service was created with exact match, it would take pecedence over the previously suffix matched service.
Closes#85
When a container is shutdown manually while it's registered as `ready` in Sablier it will remove it from the store.
Meaning externally events are now handled for docker.