@@ -32,11 +32,11 @@ type Spec struct {
3232 // Modification by Samuel Karp
3333 /*
3434 // Hostname configures the container's hostname.
35- Hostname string `json:"hostname,omitempty"`
36- // Mounts configures additional mounts (on top of Root).
37- Mounts []Mount `json:"mounts,omitempty"`
38- // Hooks configures callbacks for container lifecycle events.
39- Hooks *Hooks `json:"hooks,omitempty" platform:"linux,solaris"`
35+ Hostname string `json:"hostname,omitempty"`*/
36+ // Mounts configures additional mounts (on top of Root).
37+ Mounts []Mount `json:"mounts,omitempty"`
38+ // Hooks configures callbacks for container lifecycle events.
39+ Hooks * Hooks `json:"hooks,omitempty" platform:"linux,solaris"` /*
4040 // Annotations contains arbitrary metadata for the container.
4141 Annotations map[string]string `json:"annotations,omitempty"`
4242
@@ -86,11 +86,11 @@ type Process struct {
8686 // Env populates the process environment for the process.
8787 Env []string `json:"env,omitempty"`
8888
89+ // Cwd is the current working directory for the process and must be
90+ // relative to the container's root.
91+ Cwd string `json:"cwd"`
8992 // Modification by Samuel Karp`
9093 /*
91- // Cwd is the current working directory for the process and must be
92- // relative to the container's root.
93- Cwd string `json:"cwd"`
9494 // Capabilities are Linux capabilities that are kept for the process.
9595 Capabilities *LinuxCapabilities `json:"capabilities,omitempty" platform:"linux"`
9696 // Rlimits specifies rlimit options to apply to the process.
@@ -107,6 +107,18 @@ type Process struct {
107107 // End of modification
108108}
109109
110+ // Mount specifies a mount for a container.
111+ type Mount struct {
112+ // Destination is the absolute path where the mount will be placed in the container.
113+ Destination string `json:"destination"`
114+ // Type specifies the mount kind.
115+ Type string `json:"type,omitempty" platform:"linux,solaris"`
116+ // Source specifies the source path of the mount.
117+ Source string `json:"source,omitempty"`
118+ // Options are fstab style mount options.
119+ Options []string `json:"options,omitempty"`
120+ }
121+
110122// Root contains information about the container's root filesystem on the host.
111123type Root struct {
112124 // Path is the absolute path to the container's root filesystem.
@@ -120,6 +132,37 @@ type Root struct {
120132 // End of modification
121133}
122134
135+ // Hook specifies a command that is run at a particular event in the lifecycle of a container
136+ type Hook struct {
137+ Path string `json:"path"`
138+ Args []string `json:"args,omitempty"`
139+ Env []string `json:"env,omitempty"`
140+ Timeout * int `json:"timeout,omitempty"`
141+ }
142+
143+ // Hooks specifies a command that is run in the container at a particular event in the lifecycle of a container
144+ // Hooks for container setup and teardown
145+ type Hooks struct {
146+ // Prestart is Deprecated. Prestart is a list of hooks to be run before the container process is executed.
147+ // It is called in the Runtime Namespace
148+ Prestart []Hook `json:"prestart,omitempty"`
149+ // CreateRuntime is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called
150+ // It is called in the Runtime Namespace
151+ CreateRuntime []Hook `json:"createRuntime,omitempty"`
152+ // CreateContainer is a list of hooks to be run after the container has been created but before pivot_root or any equivalent operation has been called
153+ // It is called in the Container Namespace
154+ CreateContainer []Hook `json:"createContainer,omitempty"`
155+ // StartContainer is a list of hooks to be run after the start operation is called but before the container process is started
156+ // It is called in the Container Namespace
157+ StartContainer []Hook `json:"startContainer,omitempty"`
158+ // Poststart is a list of hooks to be run after the container process is started.
159+ // It is called in the Runtime Namespace
160+ Poststart []Hook `json:"poststart,omitempty"`
161+ // Poststop is a list of hooks to be run after the container process exits.
162+ // It is called in the Runtime Namespace
163+ Poststop []Hook `json:"poststop,omitempty"`
164+ }
165+
123166// Modification by Samuel Karp
124167/*
125168Omitted type definitions for:
0 commit comments