mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #125212 from saschagrunert/kubeadm-runtime-ready
kubeadm: check only for `RuntimeReady` condition
This commit is contained in:
commit
bce55b94cd
@ -104,7 +104,8 @@ func (runtime *CRIRuntime) IsRunning() error {
|
||||
}
|
||||
|
||||
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(
|
||||
"container runtime condition %q is not true. reason: %s, message: %s",
|
||||
condition.GetType(), condition.GetReason(), condition.GetMessage(),
|
||||
|
@ -95,6 +95,7 @@ func TestIsRunning(t *testing.T) {
|
||||
mock.StatusReturns(&v1.StatusResponse{Status: &v1.RuntimeStatus{
|
||||
Conditions: []*v1.RuntimeCondition{
|
||||
{
|
||||
Type: v1.RuntimeReady,
|
||||
Status: false,
|
||||
},
|
||||
},
|
||||
@ -103,6 +104,21 @@ func TestIsRunning(t *testing.T) {
|
||||
},
|
||||
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) {
|
||||
containerRuntime := NewContainerRuntime("")
|
||||
|
Loading…
Reference in New Issue
Block a user