mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #86724 from gongguan/fix-fake-CRI
fix fake remote CRI
This commit is contained in:
		@@ -61,6 +61,15 @@ func (f *RemoteRuntime) Start(endpoint string) error {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	go f.server.Serve(l)
 | 
						go f.server.Serve(l)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Set runtime and network conditions ready.
 | 
				
			||||||
 | 
						f.RuntimeService.FakeStatus = &kubeapi.RuntimeStatus{
 | 
				
			||||||
 | 
							Conditions: []*kubeapi.RuntimeCondition{
 | 
				
			||||||
 | 
								{Type: kubeapi.RuntimeReady, Status: true},
 | 
				
			||||||
 | 
								{Type: kubeapi.NetworkReady, Status: true},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -194,6 +194,14 @@ func (r *FakeRuntimeService) RunPodSandbox(config *runtimeapi.PodSandboxConfig,
 | 
				
			|||||||
			Network: &runtimeapi.PodSandboxNetworkStatus{
 | 
								Network: &runtimeapi.PodSandboxNetworkStatus{
 | 
				
			||||||
				Ip: FakePodSandboxIPs[0],
 | 
									Ip: FakePodSandboxIPs[0],
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
 | 
								// Without setting sandboxStatus's Linux.Namespaces.Options, kubeGenericRuntimeManager's podSandboxChanged will consider it as network
 | 
				
			||||||
 | 
								// namespace changed and always recreate sandbox which causes pod creation failed.
 | 
				
			||||||
 | 
								// Ref `sandboxStatus.GetLinux().GetNamespaces().GetOptions().GetNetwork() != networkNamespaceForPod(pod)` in podSandboxChanged function.
 | 
				
			||||||
 | 
								Linux: &runtimeapi.LinuxPodSandboxStatus{
 | 
				
			||||||
 | 
									Namespaces: &runtimeapi.Namespace{
 | 
				
			||||||
 | 
										Options: config.GetLinux().GetSecurityContext().GetNamespaceOptions(),
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
			Labels:         config.Labels,
 | 
								Labels:         config.Labels,
 | 
				
			||||||
			Annotations:    config.Annotations,
 | 
								Annotations:    config.Annotations,
 | 
				
			||||||
			RuntimeHandler: runtimeHandler,
 | 
								RuntimeHandler: runtimeHandler,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user