mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Use osInterface for Create
This commit is contained in:
		@@ -150,7 +150,7 @@ func (m *kubeGenericRuntimeManager) generateContainerConfig(container *api.Conta
 | 
				
			|||||||
		WorkingDir:  &container.WorkingDir,
 | 
							WorkingDir:  &container.WorkingDir,
 | 
				
			||||||
		Labels:      newContainerLabels(container, pod),
 | 
							Labels:      newContainerLabels(container, pod),
 | 
				
			||||||
		Annotations: newContainerAnnotations(container, pod, restartCount),
 | 
							Annotations: newContainerAnnotations(container, pod, restartCount),
 | 
				
			||||||
		Mounts:      makeMounts(opts, container, podHasSELinuxLabel),
 | 
							Mounts:      m.makeMounts(opts, container, podHasSELinuxLabel),
 | 
				
			||||||
		LogPath:     &containerLogsPath,
 | 
							LogPath:     &containerLogsPath,
 | 
				
			||||||
		Stdin:       &container.Stdin,
 | 
							Stdin:       &container.Stdin,
 | 
				
			||||||
		StdinOnce:   &container.StdinOnce,
 | 
							StdinOnce:   &container.StdinOnce,
 | 
				
			||||||
@@ -252,7 +252,7 @@ func (m *kubeGenericRuntimeManager) generateLinuxContainerConfig(container *api.
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// makeMounts generates container volume mounts for kubelet runtime api.
 | 
					// makeMounts generates container volume mounts for kubelet runtime api.
 | 
				
			||||||
func makeMounts(opts *kubecontainer.RunContainerOptions, container *api.Container, podHasSELinuxLabel bool) []*runtimeApi.Mount {
 | 
					func (m *kubeGenericRuntimeManager) makeMounts(opts *kubecontainer.RunContainerOptions, container *api.Container, podHasSELinuxLabel bool) []*runtimeApi.Mount {
 | 
				
			||||||
	volumeMounts := []*runtimeApi.Mount{}
 | 
						volumeMounts := []*runtimeApi.Mount{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for idx := range opts.Mounts {
 | 
						for idx := range opts.Mounts {
 | 
				
			||||||
@@ -278,8 +278,7 @@ func makeMounts(opts *kubecontainer.RunContainerOptions, container *api.Containe
 | 
				
			|||||||
		// of the same container.
 | 
							// of the same container.
 | 
				
			||||||
		cid := makeUID()
 | 
							cid := makeUID()
 | 
				
			||||||
		containerLogPath := filepath.Join(opts.PodContainerDir, cid)
 | 
							containerLogPath := filepath.Join(opts.PodContainerDir, cid)
 | 
				
			||||||
		// TODO: We should try to use os interface here.
 | 
							fs, err := m.osInterface.Create(containerLogPath)
 | 
				
			||||||
		fs, err := os.Create(containerLogPath)
 | 
					 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			glog.Errorf("Error on creating termination-log file %q: %v", containerLogPath, err)
 | 
								glog.Errorf("Error on creating termination-log file %q: %v", containerLogPath, err)
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user