Set masked and readonly paths based on default Unix spec
The default values of masked and readonly paths are defined in populateDefaultUnixSpec, and are used when a sandbox is created. It is not, however, used for new containers. If a container definition does not contain a security context specifying masked/readonly paths, a container created from it does not have masked and readonly paths. This patch applies the default values to masked and readonly paths of a new container, when any specific values are not specified. Fixes #1569 Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
This commit is contained in:
		@@ -959,12 +959,12 @@ func TestMaskedAndReadonlyPaths(t *testing.T) {
 | 
			
		||||
			expectedReadonly: defaultSpec.Linux.ReadonlyPaths,
 | 
			
		||||
			privileged:       false,
 | 
			
		||||
		},
 | 
			
		||||
		"should always apply CRI specified paths when disable_proc_mount = false": {
 | 
			
		||||
		"should apply default if not specified when disable_proc_mount = false": {
 | 
			
		||||
			disableProcMount: false,
 | 
			
		||||
			masked:           nil,
 | 
			
		||||
			readonly:         nil,
 | 
			
		||||
			expectedMasked:   nil,
 | 
			
		||||
			expectedReadonly: nil,
 | 
			
		||||
			expectedMasked:   defaultSpec.Linux.MaskedPaths,
 | 
			
		||||
			expectedReadonly: defaultSpec.Linux.ReadonlyPaths,
 | 
			
		||||
			privileged:       false,
 | 
			
		||||
		},
 | 
			
		||||
		"should be able to specify empty paths": {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user