connect: set task lifecycle config for injected sidecar task

fixes #7593
This commit is contained in:
Nick Ethier
2020-04-01 21:18:41 -04:00
parent df7839fe02
commit b003393cc5
2 changed files with 9 additions and 0 deletions

View File

@@ -165,6 +165,10 @@ func newConnectTask(serviceName string) *structs.Task {
MaxFileSizeMB: 2,
},
Resources: connectSidecarResources(),
Lifecycle: &structs.TaskLifecycleConfig{
Hook: structs.TaskLifecycleHookPrestart,
Sidecar: true,
},
Constraints: structs.Constraints{
connectVersionConstraint(),
},

View File

@@ -61,6 +61,11 @@ The default sidecar task is equivalent to:
sidecar_task {
name = "connect-proxy-<service>"
lifecycle {
hook = "prestart"
sidecar = true
}
driver = "docker"
config {
image = "${meta.connect.sidecar_image}"