Merge pull request #125212 from saschagrunert/kubeadm-runtime-ready

kubeadm: check only for `RuntimeReady` condition
This commit is contained in:
Kubernetes Prow Robot 2024-05-30 00:46:07 -07:00 committed by GitHub
commit bce55b94cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View File

@ -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(),

View File

@ -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("")