kubeadm: check only for RuntimeReady condition
				
					
				
			We only check for the `RuntimeReady` condition instead of anything else like the `NetworkReady` to allow kubeadm to provision the cluster. Refers to https://github.com/kubernetes/kubernetes/pull/124685#issuecomment-2138655482 Follow-up on: https://github.com/kubernetes/kubernetes/pull/124685 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
		| @@ -104,7 +104,8 @@ func (runtime *CRIRuntime) IsRunning() error { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	for _, condition := range res.GetStatus().GetConditions() { | 	for _, condition := range res.GetStatus().GetConditions() { | ||||||
| 		if !condition.GetStatus() { | 		if condition.GetType() == runtimeapi.RuntimeReady && // NetworkReady will not be tested on purpose | ||||||
|  | 			!condition.GetStatus() { | ||||||
| 			return errors.Errorf( | 			return errors.Errorf( | ||||||
| 				"container runtime condition %q is not true. reason: %s, message: %s", | 				"container runtime condition %q is not true. reason: %s, message: %s", | ||||||
| 				condition.GetType(), condition.GetReason(), condition.GetMessage(), | 				condition.GetType(), condition.GetReason(), condition.GetMessage(), | ||||||
|   | |||||||
| @@ -95,6 +95,7 @@ func TestIsRunning(t *testing.T) { | |||||||
| 				mock.StatusReturns(&v1.StatusResponse{Status: &v1.RuntimeStatus{ | 				mock.StatusReturns(&v1.StatusResponse{Status: &v1.RuntimeStatus{ | ||||||
| 					Conditions: []*v1.RuntimeCondition{ | 					Conditions: []*v1.RuntimeCondition{ | ||||||
| 						{ | 						{ | ||||||
|  | 							Type:   v1.RuntimeReady, | ||||||
| 							Status: false, | 							Status: false, | ||||||
| 						}, | 						}, | ||||||
| 					}, | 					}, | ||||||
| @@ -103,6 +104,21 @@ func TestIsRunning(t *testing.T) { | |||||||
| 			}, | 			}, | ||||||
| 			shouldError: true, | 			shouldError: true, | ||||||
| 		}, | 		}, | ||||||
|  | 		{ | ||||||
|  | 			name: "valid: runtime condition type does not match", | ||||||
|  | 			prepare: func(mock *fakeImpl) { | ||||||
|  | 				mock.StatusReturns(&v1.StatusResponse{Status: &v1.RuntimeStatus{ | ||||||
|  | 					Conditions: []*v1.RuntimeCondition{ | ||||||
|  | 						{ | ||||||
|  | 							Type:   v1.NetworkReady, | ||||||
|  | 							Status: false, | ||||||
|  | 						}, | ||||||
|  | 					}, | ||||||
|  | 				}, | ||||||
|  | 				}, nil) | ||||||
|  | 			}, | ||||||
|  | 			shouldError: false, | ||||||
|  | 		}, | ||||||
| 	} { | 	} { | ||||||
| 		t.Run(tc.name, func(t *testing.T) { | 		t.Run(tc.name, func(t *testing.T) { | ||||||
| 			containerRuntime := NewContainerRuntime("") | 			containerRuntime := NewContainerRuntime("") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sascha Grunert
					Sascha Grunert