Skip to content

Commit b276cd2

Browse files
authored
Feat: Support Running Sidecar with a Command. (zalando#2449)
* Feat: Support Running Sidecard with a Command. This PR addresses issue zalando#2448 . Some containers may not have entry points, if this is the case they would need to be run using a command. This change extends the definition of sidecar so that there is an optional command field. If the field is present then the container will be run using that command. This is a two line change that is fully backward compatible.
1 parent 548e387 commit b276cd2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pkg/apis/acid.zalan.do/v1/postgresql_type.go

+1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ type Sidecar struct {
220220
DockerImage string `json:"image,omitempty"`
221221
Ports []v1.ContainerPort `json:"ports,omitempty"`
222222
Env []v1.EnvVar `json:"env,omitempty"`
223+
Command []string `json:"command,omitempty"`
223224
}
224225

225226
// UserFlags defines flags (such as superuser, nologin) that could be assigned to individual users

pkg/cluster/k8sres.go

+1
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,7 @@ func getSidecarContainer(sidecar acidv1.Sidecar, index int, resources *v1.Resour
12221222
Resources: *resources,
12231223
Env: sidecar.Env,
12241224
Ports: sidecar.Ports,
1225+
Command: sidecar.Command,
12251226
}
12261227
}
12271228

0 commit comments

Comments
 (0)