feat(deploy): set timeout via label (!290)
All checks were successful
continuous-integration/drone/push Build is passing

Solves coop-cloud/organising#437

A timeout can be specified globally for a recipe using this label:
`coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}`. This sets the default timeout to 120s. An app specific timeout can be set using the env `TIMEOUT`.

Co-authored-by: Moritz <moritz.m@local-it.org>
Reviewed-on: coop-cloud/abra#290
This commit is contained in:
2023-04-14 14:44:18 +00:00
parent 18615eaaef
commit 31ec322c55
5 changed files with 45 additions and 4 deletions

View File

@ -149,7 +149,7 @@ update chaos deployments use the "--chaos" flag. Use it with care.
},
}
// getLabel reads docker labels in the format of "coop-cloud.${STACK_NAME}.${LABEL}".
// getLabel reads docker labels from running services in the format of "coop-cloud.${STACK_NAME}.${LABEL}".
func getLabel(cl *dockerclient.Client, stackName string, label string) (string, error) {
filter := filters.NewArgs()
filter.Add("label", fmt.Sprintf("%s=%s", convert.LabelNamespace, stackName))
@ -171,7 +171,7 @@ func getLabel(cl *dockerclient.Client, stackName string, label string) (string,
return "", nil
}
// getBoolLabel reads a boolean docker label.
// getBoolLabel reads a boolean docker label from running services
func getBoolLabel(cl *dockerclient.Client, stackName string, label string) (bool, error) {
lableValue, err := getLabel(cl, stackName, label)
if err != nil {
@ -409,7 +409,7 @@ func tryUpgrade(cl *dockerclient.Client, stackName, recipeName string, conf *run
}
if !updatesEnabled {
logrus.Debugf("Don't update %s due to disabling auto updates or missing ENABLE_AUTO_UPDATE env.", stackName)
logrus.Debugf("Don't update %s due to disabled auto updates or missing ENABLE_AUTO_UPDATE env.", stackName)
return nil
}