@@ -92,69 +92,69 @@ type Syscall struct {
9292// Config defines configuration options for executing a process inside a contained environment. 
9393type  Config  struct  {
9494	// NoPivotRoot will use MS_MOVE and a chroot to jail the process into the container's rootfs 
95- 	// This is a common option when the container is running in ramdisk 
96- 	NoPivotRoot  bool  `json:"no_pivot_root"` 
95+ 	// This is a common option when the container is running in ramdisk.  
96+ 	NoPivotRoot  bool  `json:"no_pivot_root,omitempty "` 
9797
9898	// ParentDeathSignal specifies the signal that is sent to the container's process in the case 
9999	// that the parent process dies. 
100- 	ParentDeathSignal  int  `json:"parent_death_signal"` 
100+ 	ParentDeathSignal  int  `json:"parent_death_signal,omitempty "` 
101101
102102	// Path to a directory containing the container's root filesystem. 
103103	Rootfs  string  `json:"rootfs"` 
104104
105105	// Umask is the umask to use inside of the container. 
106- 	Umask  * uint32  `json:"umask"` 
106+ 	Umask  * uint32  `json:"umask,omitempty "` 
107107
108108	// Readonlyfs will remount the container's rootfs as readonly where only externally mounted 
109109	// bind mounts are writtable. 
110- 	Readonlyfs  bool  `json:"readonlyfs"` 
110+ 	Readonlyfs  bool  `json:"readonlyfs,omitempty "` 
111111
112112	// Specifies the mount propagation flags to be applied to /. 
113- 	RootPropagation  int  `json:"rootPropagation"` 
113+ 	RootPropagation  int  `json:"rootPropagation,omitempty "` 
114114
115115	// Mounts specify additional source and destination paths that will be mounted inside the container's 
116- 	// rootfs and mount namespace if specified 
116+ 	// rootfs and mount namespace if specified.  
117117	Mounts  []* Mount  `json:"mounts"` 
118118
119119	// The device nodes that should be automatically created within the container upon container start.  Note, make sure that the node is marked as allowed in the cgroup as well! 
120120	Devices  []* devices.Device  `json:"devices"` 
121121
122- 	MountLabel  string  `json:"mount_label"` 
122+ 	MountLabel  string  `json:"mount_label,omitempty "` 
123123
124- 	// Hostname optionally sets the container's hostname if provided 
125- 	Hostname  string  `json:"hostname"` 
124+ 	// Hostname optionally sets the container's hostname if provided.  
125+ 	Hostname  string  `json:"hostname,omitempty "` 
126126
127- 	// Domainname optionally sets the container's domainname if provided 
128- 	Domainname  string  `json:"domainname"` 
127+ 	// Domainname optionally sets the container's domainname if provided.  
128+ 	Domainname  string  `json:"domainname,omitempty "` 
129129
130130	// Namespaces specifies the container's namespaces that it should setup when cloning the init process 
131- 	// If a namespace is not provided that namespace is shared from the container's parent process 
131+ 	// If a namespace is not provided that namespace is shared from the container's parent process.  
132132	Namespaces  Namespaces  `json:"namespaces"` 
133133
134134	// Capabilities specify the capabilities to keep when executing the process inside the container 
135- 	// All capabilities not specified will be dropped from the processes capability mask 
136- 	Capabilities  * Capabilities  `json:"capabilities"` 
135+ 	// All capabilities not specified will be dropped from the processes capability mask.  
136+ 	Capabilities  * Capabilities  `json:"capabilities,omitempty "` 
137137
138- 	// Networks specifies the container's network setup to be created 
139- 	Networks  []* Network  `json:"networks"` 
138+ 	// Networks specifies the container's network setup to be created.  
139+ 	Networks  []* Network  `json:"networks,omitempty "` 
140140
141- 	// Routes can be specified to create entries in the route table as the container is started 
142- 	Routes  []* Route  `json:"routes"` 
141+ 	// Routes can be specified to create entries in the route table as the container is started.  
142+ 	Routes  []* Route  `json:"routes,omitempty "` 
143143
144144	// Cgroups specifies specific cgroup settings for the various subsystems that the container is 
145- 	// placed into to limit the resources the container has available 
145+ 	// placed into to limit the resources the container has available.  
146146	Cgroups  * Cgroup  `json:"cgroups"` 
147147
148148	// AppArmorProfile specifies the profile to apply to the process running in the container and is 
149- 	// change at the time the process is execed  
149+ 	// change at the time the process is executed.  
150150	AppArmorProfile  string  `json:"apparmor_profile,omitempty"` 
151151
152152	// ProcessLabel specifies the label to apply to the process running in the container.  It is 
153- 	// commonly used by selinux 
153+ 	// commonly used by selinux.  
154154	ProcessLabel  string  `json:"process_label,omitempty"` 
155155
156156	// Rlimits specifies the resource limits, such as max open files, to set in the container 
157- 	// If Rlimits are not set, the container will inherit rlimits from the parent process 
157+ 	// If Rlimits are not set, the container will inherit rlimits from the parent process.  
158158	Rlimits  []Rlimit  `json:"rlimits,omitempty"` 
159159
160160	// OomScoreAdj specifies the adjustment to be made by the kernel when calculating oom scores 
@@ -164,35 +164,35 @@ type Config struct {
164164	// More information about kernel oom score calculation here: https://lwn.net/Articles/317814/ 
165165	OomScoreAdj  * int  `json:"oom_score_adj,omitempty"` 
166166
167- 	// UIDMappings is an array of User ID mappings for User Namespaces 
168- 	UIDMappings  []IDMap  `json:"uid_mappings"` 
167+ 	// UIDMappings is an array of User ID mappings for User Namespaces.  
168+ 	UIDMappings  []IDMap  `json:"uid_mappings,omitempty "` 
169169
170- 	// GIDMappings is an array of Group ID mappings for User Namespaces 
171- 	GIDMappings  []IDMap  `json:"gid_mappings"` 
170+ 	// GIDMappings is an array of Group ID mappings for User Namespaces.  
171+ 	GIDMappings  []IDMap  `json:"gid_mappings,omitempty "` 
172172
173173	// MaskPaths specifies paths within the container's rootfs to mask over with a bind 
174174	// mount pointing to /dev/null as to prevent reads of the file. 
175- 	MaskPaths  []string  `json:"mask_paths"` 
175+ 	MaskPaths  []string  `json:"mask_paths,omitempty "` 
176176
177177	// ReadonlyPaths specifies paths within the container's rootfs to remount as read-only 
178178	// so that these files prevent any writes. 
179- 	ReadonlyPaths  []string  `json:"readonly_paths"` 
179+ 	ReadonlyPaths  []string  `json:"readonly_paths,omitempty "` 
180180
181181	// Sysctl is a map of properties and their values. It is the equivalent of using 
182182	// sysctl -w my.property.name value in Linux. 
183- 	Sysctl  map [string ]string  `json:"sysctl"` 
183+ 	Sysctl  map [string ]string  `json:"sysctl,omitempty "` 
184184
185185	// Seccomp allows actions to be taken whenever a syscall is made within the container. 
186186	// A number of rules are given, each having an action to be taken if a syscall matches it. 
187187	// A default action to be taken if no rules match is also given. 
188- 	Seccomp  * Seccomp  `json:"seccomp"` 
188+ 	Seccomp  * Seccomp  `json:"seccomp,omitempty "` 
189189
190190	// NoNewPrivileges controls whether processes in the container can gain additional privileges. 
191191	NoNewPrivileges  bool  `json:"no_new_privileges,omitempty"` 
192192
193193	// Hooks are a collection of actions to perform at various container lifecycle events. 
194194	// CommandHooks are serialized to JSON, but other hooks are not. 
195- 	Hooks  Hooks 
195+ 	Hooks  Hooks   `json:"Hooks,omitempty"` 
196196
197197	// Version is the version of opencontainer specification that is supported. 
198198	Version  string  `json:"version"` 
@@ -202,7 +202,7 @@ type Config struct {
202202
203203	// NoNewKeyring will not allocated a new session keyring for the container.  It will use the 
204204	// callers keyring in this case. 
205- 	NoNewKeyring  bool  `json:"no_new_keyring"` 
205+ 	NoNewKeyring  bool  `json:"no_new_keyring,omitempty "` 
206206
207207	// IntelRdt specifies settings for Intel RDT group that the container is placed into 
208208	// to limit the resources (e.g., L3 cache, memory bandwidth) the container has available 
@@ -445,15 +445,15 @@ func KnownHookNames() []string {
445445
446446type  Capabilities  struct  {
447447	// Bounding is the set of capabilities checked by the kernel. 
448- 	Bounding  []string 
448+ 	Bounding  []string   `json:"Bounding,omitempty"` 
449449	// Effective is the set of capabilities checked by the kernel. 
450- 	Effective  []string 
450+ 	Effective  []string   `json:"Effective,omitempty"` 
451451	// Inheritable is the capabilities preserved across execve. 
452- 	Inheritable  []string 
452+ 	Inheritable  []string   `json:"Inheritable,omitempty"` 
453453	// Permitted is the limiting superset for effective capabilities. 
454- 	Permitted  []string 
454+ 	Permitted  []string   `json:"Permitted,omitempty"` 
455455	// Ambient is the ambient set of capabilities that are kept. 
456- 	Ambient  []string 
456+ 	Ambient  []string   `json:"Ambient,omitempty"` 
457457}
458458
459459// Deprecated: use (Hooks).Run instead. 
0 commit comments