Skip to content

Commit ac52bee

Browse files
committed
change the user of the Process to a json.RawMessage
The type of `user` becomes `json.RawMessage` instead of platform aware structure, so the Spec becomes a platform-independent structure. It makes we can parse the config.json as a Spec before knowing the os, and allows we move the linux related *.go to linux/. The runtime should parse the user with the corresponding platform specific User structure. Signed-off-by: Lai Jiangshan <[email protected]>
1 parent 26b9be2 commit ac52bee

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

config.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package specs
22

3+
import (
4+
"encoding/json"
5+
)
6+
37
// Spec is the base configuration for the container. It specifies platform
48
// independent configuration.
59
type Spec struct {
@@ -21,8 +25,8 @@ type Spec struct {
2125
type Process struct {
2226
// Terminal creates an interactive terminal for the container.
2327
Terminal bool `json:"terminal"`
24-
// User specifies user information for the process.
25-
User User `json:"user"`
28+
// User specifies user information for the process. It is a platform-specific structure.
29+
User json.RawMessage `json:"user"`
2630
// Args specifies the binary and arguments for the application to execute.
2731
Args []string `json:"args"`
2832
// Env populates the process environment for the process.

0 commit comments

Comments
 (0)