From 5d00d22b0d23e8a6a282c992cd5b88b3852ded14 Mon Sep 17 00:00:00 2001 From: Iurii Malchenko Date: Mon, 13 Nov 2023 06:57:29 +0100 Subject: [PATCH 1/4] tweaking tests log pod conditions while waiting in pod tests --- .github/workflows/ci.yml | 1 + .../kubernetes/client/TestPodSpec.scala | 28 ++++++++++++ .../com/goyeau/kubernetes/client/Utils.scala | 38 +++++++++++----- .../client/api/CronJobsApiTest.scala | 10 ++--- .../client/api/DeploymentsApiTest.scala | 10 ++--- .../kubernetes/client/api/JobsApiTest.scala | 11 +++-- .../kubernetes/client/api/PodsApiTest.scala | 45 ++++++++++--------- .../client/api/ReplicaSetsApiTest.scala | 4 +- .../client/api/StatefulSetsApiTest.scala | 4 +- .../client/operation/CreatableTests.scala | 7 ++- .../operation/MinikubeClientProvider.scala | 22 +++++---- .../client/operation/WatchableTests.scala | 7 ++- 12 files changed, 122 insertions(+), 65 deletions(-) create mode 100644 kubernetes-client/test/src/com/goyeau/kubernetes/client/TestPodSpec.scala diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba14acdf..da02926b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: push: branches: - main + - feature/* pull_request: jobs: diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/TestPodSpec.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/TestPodSpec.scala new file mode 100644 index 00000000..b7d79bef --- /dev/null +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/TestPodSpec.scala @@ -0,0 +1,28 @@ +package com.goyeau.kubernetes.client + +import cats.syntax.all.* +import io.k8s.api.core.v1.{Container, PodSpec, ResourceRequirements} +import io.k8s.apimachinery.pkg.api.resource.Quantity + +object TestPodSpec { + + val alpine: PodSpec = PodSpec( + containers = Seq( + Container( + name = "test", + image = "alpine".some, + imagePullPolicy = "IfNotPresent".some, + resources = ResourceRequirements( + requests = Map( + "memory" -> Quantity("10Mi") + ).some, + limits = Map( + "memory" -> Quantity("10Mi") + ).some + ).some + ) + ), + terminationGracePeriodSeconds = 0L.some + ) + +} diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/Utils.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/Utils.scala index 25e068bb..d96eecbb 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/Utils.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/Utils.scala @@ -10,21 +10,37 @@ object Utils { def retry[F[_], Result]( f: F[Result], initialDelay: FiniteDuration = 1.second, - maxRetries: Int = 50, - actionClue: Option[String] = None + maxRetries: Int = 10, + actionClue: Option[String] = None, + firstRun: Boolean = true )(implicit temporal: Temporal[F], F: ApplicativeError[F, Throwable], D: Defer[F], log: Logger[F] ): F[Result] = - f.handleErrorWith { exception => - if (maxRetries > 0) - log.info( - s"Retrying in $initialDelay${actionClue.map(c => s", action: $c").getOrElse("")}. Retries left: $maxRetries" - ) *> - temporal.sleep(initialDelay) *> - D.defer(retry(f, initialDelay, maxRetries - 1, actionClue)) - else F.raiseError(exception) - } + f + .flatTap { _ => + F.whenA(!firstRun)(log.info(s"Succeeded after retrying${actionClue.map(c => s", action: $c").getOrElse("")}")) + } + .handleErrorWith { exception => + val firstLine = exception.getMessage.takeWhile(_ != '\n') + val message = + if (firstLine.contains(".scala")) + firstLine.split('/').lastOption.getOrElse(firstLine) + else + firstLine + + if (maxRetries > 0) + log.info( + s"$message. Retrying in $initialDelay${actionClue.map(c => s", action: $c").getOrElse("")}. Retries left: $maxRetries" + ) *> + temporal.sleep(initialDelay) *> + D.defer(retry(f, initialDelay, maxRetries - 1, actionClue, firstRun = false)) + else + log.info( + s"Giving up ${actionClue.map(c => s", action: $c").getOrElse("")}. No retries left" + ) *> + F.raiseError(exception) + } } diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/CronJobsApiTest.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/CronJobsApiTest.scala index c0015b82..02b69e8b 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/CronJobsApiTest.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/CronJobsApiTest.scala @@ -1,8 +1,9 @@ package com.goyeau.kubernetes.client.api +import cats.syntax.all.* import cats.effect.{Async, IO} import com.goyeau.kubernetes.client.operation.* -import com.goyeau.kubernetes.client.KubernetesClient +import com.goyeau.kubernetes.client.{KubernetesClient, TestPodSpec} import org.typelevel.log4cats.Logger import org.typelevel.log4cats.slf4j.Slf4jLogger import io.k8s.api.batch.v1.{CronJob, CronJobList, CronJobSpec, JobSpec, JobTemplateSpec} @@ -40,12 +41,7 @@ class CronJobsApiTest JobSpec( template = PodTemplateSpec( metadata = Option(ObjectMeta(name = Option(resourceName))), - spec = Option( - PodSpec( - containers = Seq(Container("test", image = Option("docker"))), - restartPolicy = Option("Never") - ) - ) + spec = TestPodSpec.alpine.copy(restartPolicy = "Never".some).some ) ) ) diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/DeploymentsApiTest.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/DeploymentsApiTest.scala index c9eb635f..95c5ccee 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/DeploymentsApiTest.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/DeploymentsApiTest.scala @@ -1,12 +1,12 @@ package com.goyeau.kubernetes.client.api import cats.effect.{Async, IO} -import com.goyeau.kubernetes.client.operation._ -import com.goyeau.kubernetes.client.{IntValue, KubernetesClient, StringValue} +import com.goyeau.kubernetes.client.operation.* +import com.goyeau.kubernetes.client.{IntValue, KubernetesClient, StringValue, TestPodSpec} import org.typelevel.log4cats.Logger import org.typelevel.log4cats.slf4j.Slf4jLogger -import io.k8s.api.apps.v1._ -import io.k8s.api.core.v1._ +import io.k8s.api.apps.v1.* +import io.k8s.api.core.v1.* import io.k8s.apimachinery.pkg.apis.meta.v1.{LabelSelector, ObjectMeta} import munit.FunSuite @@ -40,7 +40,7 @@ class DeploymentsApiTest selector = LabelSelector(matchLabels = label), template = PodTemplateSpec( metadata = Option(ObjectMeta(name = Option(resourceName), labels = label)), - spec = Option(PodSpec(containers = Seq(Container("test", image = Option("docker"))))) + spec = Option(TestPodSpec.alpine) ) ) ) diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/JobsApiTest.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/JobsApiTest.scala index 76dbd858..bda601df 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/JobsApiTest.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/JobsApiTest.scala @@ -1,12 +1,13 @@ package com.goyeau.kubernetes.client.api +import cats.syntax.all.* import cats.effect.{Async, IO} -import com.goyeau.kubernetes.client.operation._ -import com.goyeau.kubernetes.client.KubernetesClient +import com.goyeau.kubernetes.client.operation.* +import com.goyeau.kubernetes.client.{KubernetesClient, TestPodSpec} import org.typelevel.log4cats.Logger import org.typelevel.log4cats.slf4j.Slf4jLogger import io.k8s.api.batch.v1.{Job, JobList, JobSpec} -import io.k8s.api.core.v1._ +import io.k8s.api.core.v1.* import io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta import munit.FunSuite @@ -37,7 +38,9 @@ class JobsApiTest template = PodTemplateSpec( metadata = Option(ObjectMeta(name = Option(resourceName))), spec = Option( - PodSpec(containers = Seq(Container("test", image = Option("docker"))), restartPolicy = Option("Never")) + TestPodSpec.alpine.copy( + restartPolicy = "Never".some + ) ) ) ) diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/PodsApiTest.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/PodsApiTest.scala index a7be3b77..d92f9798 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/PodsApiTest.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/PodsApiTest.scala @@ -1,8 +1,9 @@ package com.goyeau.kubernetes.client.api +import cats.syntax.all.* import cats.effect.unsafe.implicits.global import cats.effect.{Async, IO} -import com.goyeau.kubernetes.client.KubernetesClient +import com.goyeau.kubernetes.client.{KubernetesClient, TestPodSpec} import com.goyeau.kubernetes.client.Utils.retry import com.goyeau.kubernetes.client.api.ExecStream.{StdErr, StdOut} import com.goyeau.kubernetes.client.operation.* @@ -15,7 +16,8 @@ import munit.FunSuite import org.http4s.Status import org.typelevel.log4cats.Logger import org.typelevel.log4cats.slf4j.Slf4jLogger -import java.nio.file.{Files => JFiles} +import io.circe.syntax.* +import java.nio.file.Files as JFiles import scala.util.Random class PodsApiTest @@ -40,7 +42,7 @@ class PodsApiTest override def sampleResource(resourceName: String, labels: Map[String, String]): Pod = Pod( metadata = Option(ObjectMeta(name = Option(resourceName), labels = Option(labels))), - spec = Option(PodSpec(containers = Seq(Container("test", image = Option("docker"))))) + spec = Option(TestPodSpec.alpine) ) private val activeDeadlineSeconds = Option(5L) @@ -61,27 +63,23 @@ class PodsApiTest def testPod(podName: String, labels: Map[String, String] = Map.empty): Pod = Pod( metadata = Option(ObjectMeta(name = Option(podName), labels = Option(labels))), - spec = Option( - PodSpec( - containers = Seq( - Container( - "test", - image = Option("docker"), - command = Option(Seq("sh", "-c", "tail -f /dev/null")) + spec = TestPodSpec.alpine + .copy( + containers = TestPodSpec.alpine.containers.map { container => + container.copy( + command = Option(Seq("sh", "-c", "sleep 120")) ) - ) + } ) - ) + .some ) def testPodWithLogs(podName: String, labels: Map[String, String] = Map.empty): Pod = Pod( metadata = Option(ObjectMeta(name = Option(podName), labels = Option(labels))), - spec = Option( - PodSpec( - containers = Seq( - Container( - "test", - image = Option("docker"), + spec = TestPodSpec.alpine + .copy( + containers = TestPodSpec.alpine.containers.map { container => + container.copy( command = Option( Seq( "sh", @@ -90,9 +88,9 @@ class PodsApiTest ) ) ) - ) + } ) - ) + .some ) private val successStatus = Some(Right(v1.Status(status = Some("Success"), metadata = Some(ListMeta())))) @@ -303,9 +301,14 @@ class PodsApiTest statusCount = pod.status.flatMap(_.conditions.map(_.length)).getOrElse(0) _ <- if (notStarted || statusCount != podStatusCount) - IO.raiseError(new RuntimeException("Pod is not started")) + IO.raiseError( + new RuntimeException( + s"Pod is not started: ${pod.status.flatMap(_.conditions).toSeq.flatten.map(_.asJson.noSpaces).mkString(", ")}" + ) + ) else IO.unit } yield pod, + maxRetries = 100, actionClue = Some(s"Waiting for pod $name to be ready") ) } diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/ReplicaSetsApiTest.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/ReplicaSetsApiTest.scala index 9102aaf1..909ac68b 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/ReplicaSetsApiTest.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/ReplicaSetsApiTest.scala @@ -1,7 +1,7 @@ package com.goyeau.kubernetes.client.api import cats.effect.{Async, IO} -import com.goyeau.kubernetes.client.KubernetesClient +import com.goyeau.kubernetes.client.{KubernetesClient, TestPodSpec} import com.goyeau.kubernetes.client.operation.* import org.typelevel.log4cats.Logger import org.typelevel.log4cats.slf4j.Slf4jLogger @@ -41,7 +41,7 @@ class ReplicaSetsApiTest template = Option( PodTemplateSpec( metadata = Option(ObjectMeta(name = Option(resourceName), labels = label)), - spec = Option(PodSpec(containers = Seq(Container("test", image = Option("docker"))))) + spec = Option(TestPodSpec.alpine) ) ) ) diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/StatefulSetsApiTest.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/StatefulSetsApiTest.scala index e228c4af..afd2d40b 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/StatefulSetsApiTest.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/StatefulSetsApiTest.scala @@ -1,7 +1,7 @@ package com.goyeau.kubernetes.client.api import cats.effect.{Async, IO} -import com.goyeau.kubernetes.client.KubernetesClient +import com.goyeau.kubernetes.client.{KubernetesClient, TestPodSpec} import com.goyeau.kubernetes.client.operation.* import org.typelevel.log4cats.Logger import org.typelevel.log4cats.slf4j.Slf4jLogger @@ -41,7 +41,7 @@ class StatefulSetsApiTest selector = LabelSelector(matchLabels = label), template = PodTemplateSpec( metadata = Option(ObjectMeta(name = Option(resourceName), labels = label)), - spec = Option(PodSpec(containers = Seq(Container("test", image = Option("docker"))))) + spec = Option(TestPodSpec.alpine) ) ) ) diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/CreatableTests.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/CreatableTests.scala index e93a6808..cd8e873a 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/CreatableTests.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/CreatableTests.scala @@ -27,10 +27,13 @@ trait CreatableTests[F[_], Resource <: { def metadata: Option[ObjectMeta] }] ): F[Resource] = { val resource = sampleResource(resourceName, labels) for { - _ <- namespacedApi(namespaceName).create(resource) + status <- namespacedApi(namespaceName).create(resource) + _ <- logger.info(s"Created '$resourceName' in $namespaceName namespace: $status") + _ <- F.delay(assertEquals(status.isSuccess, true, s"$status should be successful")) resource <- retry( getChecked(namespaceName, resourceName), - actionClue = Some(s"Creating '$resourceName' in $namespaceName namespace") + actionClue = Some(s"Getting after create '$resourceName' in $namespaceName namespace"), + maxRetries = 2 ) } yield resource } diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/MinikubeClientProvider.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/MinikubeClientProvider.scala index d2783447..101ebbac 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/MinikubeClientProvider.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/MinikubeClientProvider.scala @@ -40,25 +40,29 @@ trait MinikubeClientProvider[F[_]] { }.void private def deleteNamespace(namespace: String) = kubernetesClient.use { client => - client.namespaces.deleteTerminated( + client.namespaces.delete( namespace, - DeleteOptions(gracePeriodSeconds = Some(0L)).some + DeleteOptions(gracePeriodSeconds = 0L.some, propagationPolicy = "Background".some).some ) }.void - protected def createNamespaces() = { - val ns = defaultNamespace +: extraNamespace.toList - println(s"Creating namespaces: $ns") - ns.foreach(name => unsafeRunSync(createNamespace(name))) + protected def createNamespaces(): Unit = { + val ns = defaultNamespace +: extraNamespace + unsafeRunSync( + logger.info(s"Creating namespaces: $ns") *> + ns.traverse_(name => createNamespace(name)) + ) } override def beforeAll(): Unit = createNamespaces() override def afterAll(): Unit = { - val ns = defaultNamespace +: extraNamespace.toList - println(s"Deleting namespaces: $ns") - ns.foreach(name => unsafeRunSync(deleteNamespace(name))) + val ns = defaultNamespace +: extraNamespace + unsafeRunSync( + logger.info(s"Deleting namespaces: $ns") *> + ns.traverse_(name => deleteNamespace(name)) + ) } def usingMinikube[T](body: KubernetesClient[F] => F[T]): T = diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/WatchableTests.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/WatchableTests.scala index 6d9452e5..425167fa 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/WatchableTests.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/WatchableTests.scala @@ -180,8 +180,11 @@ trait WatchableTests[F[_], Resource <: { def metadata: Option[ObjectMeta] }] val expected = Set[EventType](EventType.MODIFIED, EventType.DELETED) for { - _ <- retry(createIfMissing(defaultNamespace, name), actionClue = Some(s"createIfMissing ${defaultNamespace}/${name}")) - resource <- getChecked(defaultNamespace, name) + _ <- retry( + createIfMissing(defaultNamespace, name), + actionClue = Some(s"createIfMissing $defaultNamespace/$name") + ) + resource <- getChecked(defaultNamespace, name) resourceVersion = resource.metadata.flatMap(_.resourceVersion).get _ <- ( watchEvents(Map(defaultNamespace -> expected), name, Some(defaultNamespace), Some(resourceVersion)), From abc0cbeb299a776be00247cd7db111193c59845c Mon Sep 17 00:00:00 2001 From: Iurii Malchenko Date: Thu, 16 Nov 2023 01:08:10 +0100 Subject: [PATCH 2/4] simplify a bit --- .../kubernetes/client/TestPodSpec.scala | 7 ++++- .../kubernetes/client/api/JobsApiTest.scala | 4 +-- .../kubernetes/client/api/PodsApiTest.scala | 30 +++++-------------- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/TestPodSpec.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/TestPodSpec.scala index b7d79bef..6b51e870 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/TestPodSpec.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/TestPodSpec.scala @@ -6,11 +6,16 @@ import io.k8s.apimachinery.pkg.api.resource.Quantity object TestPodSpec { - val alpine: PodSpec = PodSpec( + val alpine: PodSpec = alpine(None) + + def alpine(command: Seq[String]): PodSpec = alpine(command.some) + + private def alpine(command: Option[Seq[String]]): PodSpec = PodSpec( containers = Seq( Container( name = "test", image = "alpine".some, + command = command, imagePullPolicy = "IfNotPresent".some, resources = ResourceRequirements( requests = Map( diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/JobsApiTest.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/JobsApiTest.scala index bda601df..fd7a4418 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/JobsApiTest.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/JobsApiTest.scala @@ -38,9 +38,7 @@ class JobsApiTest template = PodTemplateSpec( metadata = Option(ObjectMeta(name = Option(resourceName))), spec = Option( - TestPodSpec.alpine.copy( - restartPolicy = "Never".some - ) + TestPodSpec.alpine.copy(restartPolicy = "Never".some) ) ) ) diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/PodsApiTest.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/PodsApiTest.scala index d92f9798..9df4cbc3 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/PodsApiTest.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/api/PodsApiTest.scala @@ -63,32 +63,18 @@ class PodsApiTest def testPod(podName: String, labels: Map[String, String] = Map.empty): Pod = Pod( metadata = Option(ObjectMeta(name = Option(podName), labels = Option(labels))), - spec = TestPodSpec.alpine - .copy( - containers = TestPodSpec.alpine.containers.map { container => - container.copy( - command = Option(Seq("sh", "-c", "sleep 120")) - ) - } - ) - .some + spec = TestPodSpec.alpine(command = Seq("sh", "-c", "sleep 120")).some ) def testPodWithLogs(podName: String, labels: Map[String, String] = Map.empty): Pod = Pod( metadata = Option(ObjectMeta(name = Option(podName), labels = Option(labels))), - spec = TestPodSpec.alpine - .copy( - containers = TestPodSpec.alpine.containers.map { container => - container.copy( - command = Option( - Seq( - "sh", - "-c", - "echo line 1; sleep 1; echo line 2; sleep 2; echo line 3; echo line 4; echo line 5; echo line 6" - ) - ) - ) - } + spec = TestPodSpec + .alpine(command = + Seq( + "sh", + "-c", + "echo line 1; sleep 1; echo line 2; sleep 2; echo line 3; echo line 4; echo line 5; echo line 6" + ) ) .some ) From fecb458dc3110bc036ae0de518c7db2c93849805 Mon Sep 17 00:00:00 2001 From: Iurii Malchenko Date: Thu, 16 Nov 2023 01:57:55 +0100 Subject: [PATCH 3/4] revert ci on feature branches --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da02926b..ba14acdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,6 @@ on: push: branches: - main - - feature/* pull_request: jobs: From 5bc8b4323e81213c28f0597f752a2a48e10140a4 Mon Sep 17 00:00:00 2001 From: Iurii Malchenko Date: Fri, 17 Nov 2023 01:19:07 +0100 Subject: [PATCH 4/4] set propagationPolicy=Foreground in tests cleanup --- .../kubernetes/client/operation/MinikubeClientProvider.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/MinikubeClientProvider.scala b/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/MinikubeClientProvider.scala index 101ebbac..1600aea9 100644 --- a/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/MinikubeClientProvider.scala +++ b/kubernetes-client/test/src/com/goyeau/kubernetes/client/operation/MinikubeClientProvider.scala @@ -42,7 +42,7 @@ trait MinikubeClientProvider[F[_]] { private def deleteNamespace(namespace: String) = kubernetesClient.use { client => client.namespaces.delete( namespace, - DeleteOptions(gracePeriodSeconds = 0L.some, propagationPolicy = "Background".some).some + DeleteOptions(gracePeriodSeconds = 0L.some, propagationPolicy = "Foreground".some).some ) }.void