mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
rkt: Add post-start hook support.
This adds a poll-and-timeout procedure after the pod is started, to make sure the post-start hooks execute when the container is actually running. This is a temporal workaround for implementing post-hooks, a long term solution is to use lifecycle event to trigger those hooks, see https://github.com/kubernetes/kubernetes/issues/23084. Also this fixes a bug of getting container ID for a non-running container when running pre-stop hook.
This commit is contained in:
@@ -46,7 +46,7 @@ func buildContainerID(c *containerID) kubecontainer.ContainerID {
|
||||
func parseContainerID(id kubecontainer.ContainerID) (*containerID, error) {
|
||||
tuples := strings.Split(id.ID, ":")
|
||||
if len(tuples) != 2 {
|
||||
return nil, fmt.Errorf("rkt: cannot parse container ID for: %v", id)
|
||||
return nil, fmt.Errorf("rkt: cannot parse container ID for: %q, required format is [UUID:APPNAME]", id)
|
||||
}
|
||||
return &containerID{
|
||||
uuid: tuples[0],
|
||||
|
||||
Reference in New Issue
Block a user