Skip to content

Commit

Permalink
Feat: Support Running Sidecar with a Command. (#2449)
Browse files Browse the repository at this point in the history
* Feat: Support Running Sidecard with a Command.

This PR addresses issue #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.
  • Loading branch information
tabbyl21 authored Dec 23, 2024
1 parent 548e387 commit b276cd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/apis/acid.zalan.do/v1/postgresql_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ type Sidecar struct {
DockerImage string `json:"image,omitempty"`
Ports []v1.ContainerPort `json:"ports,omitempty"`
Env []v1.EnvVar `json:"env,omitempty"`
Command []string `json:"command,omitempty"`
}

// UserFlags defines flags (such as superuser, nologin) that could be assigned to individual users
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/k8sres.go
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ func getSidecarContainer(sidecar acidv1.Sidecar, index int, resources *v1.Resour
Resources: *resources,
Env: sidecar.Env,
Ports: sidecar.Ports,
Command: sidecar.Command,
}
}

Expand Down

0 comments on commit b276cd2

Please sign in to comment.