@@ -23,6 +23,7 @@ import (
2323 meta "k8s.io/apimachinery/pkg/api/meta"
2424 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2525 "k8s.io/apimachinery/pkg/runtime"
26+ "k8s.io/apimachinery/pkg/types"
2627 "k8s.io/client-go/kubernetes"
2728 "k8s.io/kubernetes/test/e2e/framework"
2829 e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
@@ -488,6 +489,10 @@ var _ = g.Describe("[sig-network][OCPFeatureGate:RouteAdvertisements][Feature:Ro
488489 g .By ("deploy nmstate handler" )
489490 err = deployNmstateHandler (oc )
490491 o .Expect (err ).NotTo (o .HaveOccurred ())
492+
493+ // This is a workaround for OCPBUGS-56488: scale down
494+ // nmstate operator and disable liveness probe
495+ o .Eventually (workaroundOCPBUGS56488 ).WithArguments (oc ).WithTimeout (3 * time .Minute ).WithPolling (5 * time .Second ).Should (o .BeTrue ())
491496 })
492497
493498 g .AfterEach (func () {
@@ -1425,10 +1430,10 @@ func gatherDebugInfo(oc *exutil.CLI, snifferDaemonset *v1.DaemonSet, targetNames
14251430 logs , err := getDaemonSetLogs (oc .KubeFramework ().ClientSet , snifferDaemonset )
14261431 if err != nil {
14271432 framework .Logf ("failed to gather packet sniffer logs: %v" , err )
1428- return
1429- }
1430- for node , log := range logs {
1431- framework . Logf ( "packet sniffer logs for node %s: \n %s" , node , log )
1433+ } else {
1434+ for node , log := range logs {
1435+ framework . Logf ( "packet sniffer logs for node %s: \n %s" , node , log )
1436+ }
14321437 }
14331438 }
14341439
@@ -1505,3 +1510,21 @@ func gatherDebugInfo(oc *exutil.CLI, snifferDaemonset *v1.DaemonSet, targetNames
15051510 }
15061511 }
15071512}
1513+
1514+ func workaroundOCPBUGS56488 (oc * exutil.CLI ) (bool , error ) {
1515+ opPatch := []byte (`{"spec":{"replicas": 0}}` )
1516+ dp , err := oc .AdminKubeClient ().AppsV1 ().Deployments (nmstateNamespace ).Patch (context .Background (), "nmstate-operator" , types .MergePatchType , opPatch , metav1.PatchOptions {})
1517+ if err != nil {
1518+ return false , err
1519+ }
1520+ err = exutil .WaitForDeploymentReadyWithTimeout (oc , "nmstate-operator" , nmstateNamespace , dp .Generation , 0 )
1521+ if err != nil {
1522+ return false , err
1523+ }
1524+ hPatch := []byte (`{"spec":{"template":{"spec":{"containers":[{"name":"nmstate-handler","livenessProbe":{"exec":{"command": ["true"]}}}]}}}}` )
1525+ ds , err := oc .AdminKubeClient ().AppsV1 ().DaemonSets (nmstateNamespace ).Patch (context .Background (), "nmstate-handler" , types .StrategicMergePatchType , hPatch , metav1.PatchOptions {})
1526+ if err != nil {
1527+ return false , err
1528+ }
1529+ return isDaemonSetRunningOnGeneration (oc , nmstateNamespace , "nmstate-handler" , ds .Generation )
1530+ }
0 commit comments