feat: add filter by labels (#134)

You are now able to use labels on containers and services such as `--sablier.enable=true` and `--sablier.group=mygroup` to select groups.
This commit is contained in:
Alexis Couvreur
2023-03-28 21:31:22 -04:00
committed by GitHub
parent f7b4c94c24
commit 795792058f
19 changed files with 403 additions and 83 deletions

View File

@@ -69,6 +69,7 @@ You can configure the middleware behavior with the following variables:
- `set $sablierUrl` The internal routing to reach Sablier API
- `set $sablierNames` Comma separated names of containers/services/deployments etc.
- `set $sablierGroup` Group name to use to filter by label, ignored if sablierNames is set
- `set $sablierSessionDuration` The session duration after which containers/services/deployments instances are shutdown
- `set $sablierNginxInternalRedirect` The internal location for the service to redirect e.g. @nginx

View File

@@ -22,6 +22,7 @@ function call(r) {
* @typedef {Object} SablierConfig
* @property {string} sablierUrl
* @property {string} names
* @property {string} group
* @property {string} sessionDuration
* @property {string} internalRedirect
* @property {string} displayName
@@ -41,6 +42,7 @@ function createConfigurationFromVariables(r) {
return {
sablierUrl: r.variables.sablierUrl,
names: r.variables.sablierNames,
group: r.variables.sablierGroup,
sessionDuration: r.variables.sablierSessionDuration,
internalRedirect: r.variables.sablierNginxInternalRedirect,