-
Notifications
You must be signed in to change notification settings - Fork 1
/
funcSetContainerHealthcheck.go
60 lines (59 loc) · 2.51 KB
/
funcSetContainerHealthcheck.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package iotmakerdockerbuilder
// SetContainerHealthcheck
//
// English:
//
// Holds configuration settings for the HEALTHCHECK feature.
//
// Input:
// value: Ponteiro para HealthConfig
// Test: Test is the test to perform to check that the container is healthy.
// An empty slice means to inherit the default.
// The options are:
// {}: inherit healthcheck
// {"NONE"}: disable healthcheck
// {"CMD", args...}: exec arguments directly
// {"CMD-SHELL", command}: run command with system's default shell
//
// Interval: Interval is the time to wait between checks (Zero means inherit).
//
// Timeout: Timeout is the time to wait before considering the check to have hung (Zero means
// inherit).
//
// StartPeriod: The start period for the container to initialize before the retries starts to
// count down (Zero means inherit).
//
// Retries: Retries is the number of consecutive failures needed to consider a container as
// unhealthy (Zero means inherit).
//
// Português:
//
// Adiciona definições de configuração para o recurso HEALTHCHECK.
//
// Entrada:
// value: Ponteiro para HealthConfig
// Test: Test é o teste a ser executado para testar a saúde do container se não for definido,
// herda o teste padrão
// As opções são:
// {}: herda o teste padrão
// {"NONE"}: desabilita o healthcheck
// {"CMD", args...}: executa os argumentos diretamente
// {"CMD-SHELL", command} : executa o comando com shell padrão do sistema
//
// Interval: intervalo entre testes (zero herda o valor padrão).
//
// Timeout: intervalo de espera antes de considerar o teste com problemas (zero herda o valor
// padrão).
//
// StartPeriod: tempo de espera pela incialização do container antes dos testes começarem
// (zero herda o valor padrão).
//
// Retries: número de testes consecutivos antes de considerar o teste com problemas (zero
// herda o valor padrão).
func (e *ContainerBuilder) SetContainerHealthcheck(value *HealthConfig) {
e.containerConfig.Healthcheck.Test = value.Test
e.containerConfig.Healthcheck.Interval = value.Interval
e.containerConfig.Healthcheck.Timeout = value.Timeout
e.containerConfig.Healthcheck.StartPeriod = value.StartPeriod
e.containerConfig.Healthcheck.Retries = value.Retries
}