Description
There is a semantic difference between exec and apply commands and when one should use them. For example,
- exec commands are commands that are required to be executed only when a container is up and running.
- apply commands are commands that are typically applied for example during preStart and postStop events, when a pod is not present.
However, having personally worked on Odo's preStart feature, this is not the case. Odo currently utilizes only exec and composite commands in its product. This is the case for preStart as well, where a preStart event is an exec command. The container component's command & args(image's command & args if the devfile container command & args are absent) are overridden by the exec command's commandLine
& workingDir
.
This is different to what the authors of the spec initially intended. The apply command's container component image command & args are to be used as preStart or postStop commands.
Having mentioned that, there is a use-case where we can utilize an exec command for preStart/postStop when the dedicatedPod
in the container component is set to true. This use case can be useful and valid when a separate pod is required to that of the main pod. The dedicated pod can utilize the pvc volumes defined to execute its preStart & postStop actions whose data could be accessed by the main pod via the pvc volumes.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status