@@ -363,6 +363,17 @@ func SimplePISTest(oc *exutil.CLI, kubeClient *kubernetes.Clientset, clientSet *
363363
364364func detectXCondition (oc * exutil.CLI , node corev1.Node , mcn * mcfgv1.MachineConfigNode , appliedPIS * mcfgv1.PinnedImageSet , detectingSuccess bool , isMetalDisconnected bool ) (bool , bool , error ) {
365365 if detectingSuccess {
366+ if isMetalDisconnected {
367+ crictlStatus , err := exutil .DebugNodeRetryWithOptionsAndChroot (oc , node .Name , "openshift-machine-config-operator" , "crictl" , "inspecti" , emptyImagePin )
368+ if err != nil {
369+ return false , false , fmt .Errorf ("failed to execute `crictl inspecti %s` on node %s: %w" , emptyImagePin , node .Name , err )
370+ }
371+ if ! strings .Contains (crictlStatus , "imageSpec" ) {
372+ return false , false , fmt .Errorf ("Image %s not present on node %s: %w" , emptyImagePin , node .Name , err )
373+ }
374+ return true , false , nil
375+ }
376+
366377 for _ , cond := range mcn .Status .Conditions {
367378 if mcfgv1 .StateProgress (cond .Type ) == mcfgv1 .MachineConfigNodePinnedImageSetsDegraded && cond .Status == "True" {
368379 return false , true , fmt .Errorf ("PIS degraded for MCN %s with reason: %s and message: %s" , mcn .Name , cond .Reason , cond .Message )
@@ -373,16 +384,6 @@ func detectXCondition(oc *exutil.CLI, node corev1.Node, mcn *mcfgv1.MachineConfi
373384 }
374385 }
375386 for _ , img := range appliedPIS .Spec .PinnedImages {
376- if isMetalDisconnected {
377- crictlStatus , err := exutil .DebugNodeRetryWithOptionsAndChroot (oc , node .Name , "openshift-machine-config-operator" , "crictl" , "inspecti" , emptyImagePin )
378- if err != nil {
379- return false , false , fmt .Errorf ("failed to execute `crictl inspecti %s` on node %s: %w" , img .Name , node .Name , err )
380- }
381- if ! strings .Contains (crictlStatus , "imageSpec" ) {
382- return false , false , fmt .Errorf ("Image %s not present on node %s: %w" , img .Name , node .Name , err )
383- }
384- break
385- }
386387 crictlStatus , err := exutil .DebugNodeRetryWithOptionsAndChroot (oc , node .Name , "openshift-machine-config-operator" , "crictl" , "inspecti" , string (img .Name ))
387388 if err != nil {
388389 return false , false , fmt .Errorf ("failed to execute `crictl inspecti %s` on node %s: %w" , img .Name , node .Name , err )
0 commit comments