From 1a7531be7dd076c0f38396db596f187ace7d2a91 Mon Sep 17 00:00:00 2001 From: Hagai Hillel Date: Sun, 14 Jul 2024 01:00:35 +0300 Subject: [PATCH] uprade nginx --- .../src/it/scala/skuber/DeploymentSpec.scala | 20 +++++++++---------- .../DynamicKubernetesClientImplTest.scala | 4 ++-- client/src/it/scala/skuber/ExecSpec.scala | 12 +++++------ .../HorizontalPodAutoscalerV2Beta1Spec.scala | 6 +++--- .../HorizontalPodAutoscalerV2Spec.scala | 6 +++--- client/src/it/scala/skuber/K8SFixture.scala | 2 +- client/src/it/scala/skuber/PatchSpec.scala | 10 +++++----- .../skuber/PodDisruptionBudgetSpec.scala | 6 +++--- client/src/it/scala/skuber/PodLogSpec.scala | 2 +- client/src/it/scala/skuber/PodSpec.scala | 12 +++++------ .../scala/skuber/WatchContinuouslySpec.scala | 10 +++++----- .../scala/skuber/format/PodFormatSpec.scala | 2 +- client/src/test/resources/exampleNode.json | 2 +- .../test/resources/exampleStatefulSet.json | 2 +- .../scala/skuber/apps/DeploymentSpec.scala | 2 +- .../scala/skuber/apps/v1/DeploymentSpec.scala | 2 +- .../scala/skuber/ext/DeploymentSpec.scala | 2 +- .../skuber/json/EndpointsFormatSpec.scala | 2 +- .../skuber/json/NamespaceFormatSpec.scala | 3 ++- .../scala/skuber/json/NodeFormatSpec.scala | 4 ++-- .../ReplicationControllerFormatSpec.scala | 2 +- .../scala/skuber/json/ServiceFormatSpec.scala | 2 +- docs/README.md | 4 ++-- .../deployment/DeploymentExamples.scala | 6 +++--- .../DynamicKubernetesClientImplExample.scala | 2 +- 25 files changed, 64 insertions(+), 63 deletions(-) diff --git a/client/src/it/scala/skuber/DeploymentSpec.scala b/client/src/it/scala/skuber/DeploymentSpec.scala index 96a67df8..cf2e1eb2 100644 --- a/client/src/it/scala/skuber/DeploymentSpec.scala +++ b/client/src/it/scala/skuber/DeploymentSpec.scala @@ -63,7 +63,7 @@ class DeploymentSpec extends K8SFixture with Eventually with Matchers with Befor it should "create a deployment" in { k8s => - val createdDeployment = k8s.create(getNginxDeployment(deploymentName1, "1.7.9")).valueT + val createdDeployment = k8s.create(getNginxDeployment(deploymentName1, "1.27.0")).valueT assert(createdDeployment.name == deploymentName1) val getDeployment = k8s.get[Deployment](deploymentName1).valueT @@ -72,7 +72,7 @@ class DeploymentSpec extends K8SFixture with Eventually with Matchers with Befor it should "create a deployment in specific namespace" in { k8s => createNamespace(namespace1, k8s) - val createdDeployment = k8s.create(getNginxDeployment(deploymentSpecific1, "1.7.9"), Some(namespace1)).valueT + val createdDeployment = k8s.create(getNginxDeployment(deploymentSpecific1, "1.27.0"), Some(namespace1)).valueT createdDeployment.name shouldBe deploymentSpecific1 val getDeployment = k8s.get[Deployment](deploymentSpecific1, Some(namespace1)).valueT @@ -85,7 +85,7 @@ class DeploymentSpec extends K8SFixture with Eventually with Matchers with Befor it should "update a deployment in specific namespace" in { k8s => createNamespace(namespace2, k8s) - val createdDeployment = k8s.create(getNginxDeployment(deploymentSpecific2, "1.7.9"), Some(namespace2)).valueT + val createdDeployment = k8s.create(getNginxDeployment(deploymentSpecific2, "1.27.0"), Some(namespace2)).valueT createdDeployment.name shouldBe deploymentSpecific2 val expectedReplicas = 2 @@ -106,7 +106,7 @@ class DeploymentSpec extends K8SFixture with Eventually with Matchers with Befor it should "upgrade the newly created deployment" in { k8s => - k8s.create(getNginxDeployment(deploymentName2, "1.7.9")).valueT + k8s.create(getNginxDeployment(deploymentName2, "1.27.0")).valueT Thread.sleep(5000) val getDeployment = k8s.get[Deployment](deploymentName2).valueT println(s"DEPLOYMENT TO UPDATE ==> $getDeployment") @@ -127,7 +127,7 @@ class DeploymentSpec extends K8SFixture with Eventually with Matchers with Befor it should "delete a deployment" in { k8s => - val d = k8s.create(getNginxDeployment(deploymentName3, "1.7.9")).valueT + val d = k8s.create(getNginxDeployment(deploymentName3, "1.27.0")).valueT assert(d.name == deploymentName3) k8s.delete[Deployment](deploymentName3).valueT @@ -146,7 +146,7 @@ class DeploymentSpec extends K8SFixture with Eventually with Matchers with Befor it should "delete a deployment in specific namespace" in { k8s => createNamespace(namespace3, k8s) - val d = k8s.create(getNginxDeployment(deploymentSpecific3, "1.7.9"), Some(namespace3)).valueT + val d = k8s.create(getNginxDeployment(deploymentSpecific3, "1.27.0"), Some(namespace3)).valueT assert(d.name == deploymentSpecific3) k8s.delete[Deployment](deploymentSpecific3, namespace = Some(namespace3)).valueT @@ -165,8 +165,8 @@ class DeploymentSpec extends K8SFixture with Eventually with Matchers with Befor it should "deleteAll - delete all deployments in specific namespace" in { k8s => createNamespace(namespace4, k8s) - k8s.create(getNginxDeployment(deploymentSpecific41, "1.7.9"), Some(namespace4)).valueT - k8s.create(getNginxDeployment(deploymentSpecific42, "1.7.9"), Some(namespace4)).valueT + k8s.create(getNginxDeployment(deploymentSpecific41, "1.27.0"), Some(namespace4)).valueT + k8s.create(getNginxDeployment(deploymentSpecific42, "1.27.0"), Some(namespace4)).valueT k8s.deleteAll[DeploymentList](namespace = Some(namespace4)).valueT @@ -193,8 +193,8 @@ class DeploymentSpec extends K8SFixture with Eventually with Matchers with Befor it should "list deployment in specific namespace" in { k8s => createNamespace(namespace5, k8s) - k8s.create(getNginxDeployment(deploymentSpecific51, "1.7.9"), Some(namespace5)).valueT - k8s.create(getNginxDeployment(deploymentSpecific52, "1.7.9"), Some(namespace5)).valueT + k8s.create(getNginxDeployment(deploymentSpecific51, "1.27.0"), Some(namespace5)).valueT + k8s.create(getNginxDeployment(deploymentSpecific52, "1.27.0"), Some(namespace5)).valueT val expectedDeploymentList = List(deploymentSpecific51, deploymentSpecific52) val actualDeploymentList = diff --git a/client/src/it/scala/skuber/DynamicKubernetesClientImplTest.scala b/client/src/it/scala/skuber/DynamicKubernetesClientImplTest.scala index 0ba218e6..cc5bbce5 100644 --- a/client/src/it/scala/skuber/DynamicKubernetesClientImplTest.scala +++ b/client/src/it/scala/skuber/DynamicKubernetesClientImplTest.scala @@ -67,7 +67,7 @@ class DynamicKubernetesClientImplTest extends K8SFixture with Eventually with Ma "containers": [ { "name": "nginx", - "image": "nginx:1.7.9", + "image": "nginx:1.27.0", "ports": [ { "containerPort": 80, @@ -127,7 +127,7 @@ class DynamicKubernetesClientImplTest extends K8SFixture with Eventually with Ma "containers": [ { "name": "nginx", - "image": "nginx:1.7.9", + "image": "nginx:1.27.0", "ports": [ { "containerPort": 80, diff --git a/client/src/it/scala/skuber/ExecSpec.scala b/client/src/it/scala/skuber/ExecSpec.scala index e8e46616..6ff8a90e 100644 --- a/client/src/it/scala/skuber/ExecSpec.scala +++ b/client/src/it/scala/skuber/ExecSpec.scala @@ -42,7 +42,7 @@ class ExecSpec extends K8SFixture with Eventually with Matchers with BeforeAndAf it should "execute a command in the running pod" in { k8s => println("START: execute a command in the running pod") - k8s.create(getNginxPod(podName1, "1.7.9")).valueT + k8s.create(getNginxPod(podName1, "1.27.0")).valueT Thread.sleep(5000) eventually(timeout(30.seconds), interval(3.seconds)) { @@ -60,7 +60,7 @@ class ExecSpec extends K8SFixture with Eventually with Matchers with BeforeAndAf it should "execute a command in the specified container of the running pod" in { k8s => println("START: execute a command in the specified container of the running pod") - k8s.create(getNginxPod(podName2, "1.7.9")).valueT + k8s.create(getNginxPod(podName2, "1.27.0")).valueT Thread.sleep(5000) eventually(timeout(30.seconds), interval(3.seconds)) { @@ -79,7 +79,7 @@ class ExecSpec extends K8SFixture with Eventually with Matchers with BeforeAndAf it should "execute a command that outputs to stderr in the running pod" in { k8s => println("START: execute a command that outputs to stderr in the running pod") - k8s.create(getNginxPod(podName3, "1.7.9")).valueT + k8s.create(getNginxPod(podName3, "1.27.0")).valueT Thread.sleep(5000) var output = "" val stdout: Sink[String, Future[Done]] = Sink.foreach(output += _) @@ -96,7 +96,7 @@ class ExecSpec extends K8SFixture with Eventually with Matchers with BeforeAndAf it should "execute a command in an interactive shell of the running pod - specific namespace" in { k8s => println("START: execute a command in an interactive shell of the running pod") createNamespace(namespace1, k8s) - k8s.create(getNginxPod(podName4, "1.7.9"), namespace = Some(namespace1)).valueT + k8s.create(getNginxPod(podName4, "1.27.0"), namespace = Some(namespace1)).valueT Thread.sleep(5000) val stdin = Source.single("whoami\n") var output = "" @@ -115,7 +115,7 @@ class ExecSpec extends K8SFixture with Eventually with Matchers with BeforeAndAf it should "throw an exception without stdin, stdout nor stderr in the running pod" in { k8s => println("START: throw an exception without stdin, stdout nor stderr in the running pod") - k8s.create(getNginxPod(podName5, "1.7.9")).valueT + k8s.create(getNginxPod(podName5, "1.27.0")).valueT Thread.sleep(5000) whenReady { val res = k8s.exec(podName5, Seq("whoami")).withTimeout().failed @@ -132,7 +132,7 @@ class ExecSpec extends K8SFixture with Eventually with Matchers with BeforeAndAf it should "throw an exception against an unexisting pod" in { k8s => println("START: throw an exception against an unexisting pod") - k8s.create(getNginxPod(podName6, "1.7.9")).valueT + k8s.create(getNginxPod(podName6, "1.27.0")).valueT Thread.sleep(5000) whenReady(k8s.exec(podName6 + "x", Seq("whoami")).withTimeout().failed) { result => println("FINISH: throw an exception against an unexisting pod") diff --git a/client/src/it/scala/skuber/HorizontalPodAutoscalerV2Beta1Spec.scala b/client/src/it/scala/skuber/HorizontalPodAutoscalerV2Beta1Spec.scala index 0f8a9e48..fa734427 100644 --- a/client/src/it/scala/skuber/HorizontalPodAutoscalerV2Beta1Spec.scala +++ b/client/src/it/scala/skuber/HorizontalPodAutoscalerV2Beta1Spec.scala @@ -56,7 +56,7 @@ class HorizontalPodAutoscalerV2Beta1Spec extends K8SFixture with Eventually with it should "create a HorizontalPodAutoscaler" in { k8s => println(horizontalPodAutoscaler1) - k8s.create(getNginxDeployment(deployment1, "1.7.9")).valueT + k8s.create(getNginxDeployment(deployment1, "1.27.0")).valueT val result = k8s.create(HorizontalPodAutoscaler(horizontalPodAutoscaler1).withSpec(HorizontalPodAutoscaler.Spec("v1", "Deployment", "nginx") .withMinReplicas(1) .withMaxReplicas(2) @@ -71,7 +71,7 @@ class HorizontalPodAutoscalerV2Beta1Spec extends K8SFixture with Eventually with it should "update a HorizontalPodAutoscaler" in { k8s => - k8s.create(getNginxDeployment(deployment2, "1.7.9")).valueT + k8s.create(getNginxDeployment(deployment2, "1.27.0")).valueT val created = k8s.create(HorizontalPodAutoscaler(horizontalPodAutoscaler2).withSpec(HorizontalPodAutoscaler.Spec("v1", "Deployment", "nginx") .withMinReplicas(1) .withMaxReplicas(2) @@ -101,7 +101,7 @@ class HorizontalPodAutoscalerV2Beta1Spec extends K8SFixture with Eventually with it should "delete a HorizontalPodAutoscaler" in { k8s => - k8s.create(getNginxDeployment(deployment3, "1.7.9")).valueT + k8s.create(getNginxDeployment(deployment3, "1.27.0")).valueT val created = k8s.create(HorizontalPodAutoscaler(horizontalPodAutoscaler3).withSpec(HorizontalPodAutoscaler.Spec("v1", "Deployment", "nginx") .withMinReplicas(1) .withMaxReplicas(2) diff --git a/client/src/it/scala/skuber/HorizontalPodAutoscalerV2Spec.scala b/client/src/it/scala/skuber/HorizontalPodAutoscalerV2Spec.scala index b6c27fea..1bf79c09 100644 --- a/client/src/it/scala/skuber/HorizontalPodAutoscalerV2Spec.scala +++ b/client/src/it/scala/skuber/HorizontalPodAutoscalerV2Spec.scala @@ -59,7 +59,7 @@ class HorizontalPodAutoscalerV2Spec extends K8SFixture with Eventually with Matc it should "create a HorizontalPodAutoscaler" taggedAs HorizontalPodAutoscalerV2Tag in { k8s => println(horizontalPodAutoscaler1) - k8s.create(getNginxDeployment(deployment1, "1.7.9")).valueT + k8s.create(getNginxDeployment(deployment1, "1.27.0")).valueT val result = k8s.create(HorizontalPodAutoscaler(horizontalPodAutoscaler1).withSpec(HorizontalPodAutoscaler.Spec("v1", "Deployment", "nginx") .withMinReplicas(1) .withMaxReplicas(2) @@ -82,7 +82,7 @@ class HorizontalPodAutoscalerV2Spec extends K8SFixture with Eventually with Matc it should "update a HorizontalPodAutoscaler" taggedAs HorizontalPodAutoscalerV2Tag in { k8s => - k8s.create(getNginxDeployment(deployment2, "1.7.9")).valueT + k8s.create(getNginxDeployment(deployment2, "1.27.0")).valueT val created = k8s.create(HorizontalPodAutoscaler(horizontalPodAutoscaler2).withSpec(HorizontalPodAutoscaler.Spec("v1", "Deployment", "nginx") .withMinReplicas(1) .withMaxReplicas(2) @@ -112,7 +112,7 @@ class HorizontalPodAutoscalerV2Spec extends K8SFixture with Eventually with Matc it should "delete a HorizontalPodAutoscaler" taggedAs HorizontalPodAutoscalerV2Tag in { k8s => - k8s.create(getNginxDeployment(deployment3, "1.7.9")).valueT + k8s.create(getNginxDeployment(deployment3, "1.27.0")).valueT val created = k8s.create(HorizontalPodAutoscaler(horizontalPodAutoscaler3).withSpec(HorizontalPodAutoscaler.Spec("v1", "Deployment", "nginx") .withMinReplicas(1) .withMaxReplicas(2) diff --git a/client/src/it/scala/skuber/K8SFixture.scala b/client/src/it/scala/skuber/K8SFixture.scala index 6c9fc7b9..36b09bdd 100644 --- a/client/src/it/scala/skuber/K8SFixture.scala +++ b/client/src/it/scala/skuber/K8SFixture.scala @@ -35,7 +35,7 @@ trait K8SFixture extends FixtureAnyFlatSpec { def getNginxContainer(version: String): Container = Container(name = "nginx", image = "nginx:" + version).exposePort(80) - def getNginxDeployment(name: String, version: String = "1.7.9", labels: Map[String, String] = Map.empty): Deployment = { + def getNginxDeployment(name: String, version: String = "1.27.0", labels: Map[String, String] = Map.empty): Deployment = { import LabelSelector.dsl._ val nginxContainer = getNginxContainer(version) val nginxTemplate = Pod.Template.Spec.named("nginx").addContainer(nginxContainer).addLabel("app" -> "nginx") diff --git a/client/src/it/scala/skuber/PatchSpec.scala b/client/src/it/scala/skuber/PatchSpec.scala index 36bfe6fd..bd88a621 100644 --- a/client/src/it/scala/skuber/PatchSpec.scala +++ b/client/src/it/scala/skuber/PatchSpec.scala @@ -41,7 +41,7 @@ class PatchSpec extends K8SFixture with Eventually with Matchers with BeforeAndA behavior of "Patch" it should "patch a pod with strategic merge patch by default" in { k8s => - k8s.create(getNginxPod(pod1, "1.7.9")).withTimeout().futureValue + k8s.create(getNginxPod(pod1, "1.27.0")).withTimeout().futureValue Thread.sleep(5000) val randomString = randomUUID().toString val patchData = MetadataPatch(labels = Some(Map("foo" -> randomString)), annotations = None) @@ -55,7 +55,7 @@ class PatchSpec extends K8SFixture with Eventually with Matchers with BeforeAndA } it should "patch a pod with strategic merge patch" in { k8s => - k8s.create(getNginxPod(pod2, "1.7.9")).valueT + k8s.create(getNginxPod(pod2, "1.27.0")).valueT Thread.sleep(5000) val randomString = randomUUID().toString val patchData = MetadataPatch(labels = Some(Map("foo" -> randomString)), annotations = None, strategy = StrategicMergePatchStrategy) @@ -70,7 +70,7 @@ class PatchSpec extends K8SFixture with Eventually with Matchers with BeforeAndA } it should "patch a pod with json merge patch" in { k8s => - k8s.create(getNginxPod(pod3, "1.7.9")).valueT + k8s.create(getNginxPod(pod3, "1.27.0")).valueT Thread.sleep(5000) val randomString = randomUUID().toString val patchData = MetadataPatch(labels = Some(Map("foo" -> randomString)), annotations = None, strategy = JsonMergePatchStrategy) @@ -85,7 +85,7 @@ class PatchSpec extends K8SFixture with Eventually with Matchers with BeforeAndA it should "patch a pod with json patch" in { k8s => - k8s.create(getNginxPod(pod4, "1.7.9")).valueT + k8s.create(getNginxPod(pod4, "1.27.0")).valueT Thread.sleep(5000) val randomString = randomUUID().toString @@ -105,7 +105,7 @@ class PatchSpec extends K8SFixture with Eventually with Matchers with BeforeAndA it should "patch a pod with json patch - specific namespace" in { k8s => createNamespace(namespace5, k8s) - k8s.create(getNginxPod(pod5, "1.7.9"), Some(namespace5)).valueT + k8s.create(getNginxPod(pod5, "1.27.0"), Some(namespace5)).valueT Thread.sleep(5000) val randomString = randomUUID().toString diff --git a/client/src/it/scala/skuber/PodDisruptionBudgetSpec.scala b/client/src/it/scala/skuber/PodDisruptionBudgetSpec.scala index 00d361d3..d5dd4c48 100644 --- a/client/src/it/scala/skuber/PodDisruptionBudgetSpec.scala +++ b/client/src/it/scala/skuber/PodDisruptionBudgetSpec.scala @@ -56,7 +56,7 @@ class PodDisruptionBudgetSpec extends K8SFixture with Matchers with BeforeAndAft it should "create a PodDisruptionBudget" in { k8s => println("START: create a PodDisruptionBudget") - k8s.create(getNginxDeployment(deployment1, "1.7.9")).valueT + k8s.create(getNginxDeployment(deployment1, "1.27.0")).valueT import LabelSelector.dsl._ val labelSelector = LabelSelector(IsEqualRequirement("app", "nginx")) val result = k8s.create(PodDisruptionBudget(budget1).withMinAvailable(Left(1)).withLabelSelector(labelSelector)).valueT @@ -70,7 +70,7 @@ class PodDisruptionBudgetSpec extends K8SFixture with Matchers with BeforeAndAft it should "update a PodDisruptionBudget" in { k8s => println("START: update a PodDisruptionBudget") - val deployment = k8s.create(getNginxDeployment(deployment2, "1.7.9")).withTimeout() + val deployment = k8s.create(getNginxDeployment(deployment2, "1.27.0")).withTimeout() deployment.futureValue import LabelSelector.dsl._ val labelSelector = LabelSelector(IsEqualRequirement("app", "nginx")) @@ -95,7 +95,7 @@ class PodDisruptionBudgetSpec extends K8SFixture with Matchers with BeforeAndAft it should "delete a PodDisruptionBudget" in { k8s => println("START: delete a PodDisruptionBudget") - k8s.create(getNginxDeployment(deployment3, "1.7.9")).valueT + k8s.create(getNginxDeployment(deployment3, "1.27.0")).valueT import LabelSelector.dsl._ val labelSelector = LabelSelector(IsEqualRequirement("app", "nginx")) val pdb = k8s.create(PodDisruptionBudget(budget3).withMinAvailable(Left(1)).withLabelSelector(labelSelector)).valueT diff --git a/client/src/it/scala/skuber/PodLogSpec.scala b/client/src/it/scala/skuber/PodLogSpec.scala index 642758c5..016b457f 100644 --- a/client/src/it/scala/skuber/PodLogSpec.scala +++ b/client/src/it/scala/skuber/PodLogSpec.scala @@ -32,7 +32,7 @@ class PodLogSpec extends K8SFixture with Eventually with Matchers with BeforeAnd } it should "get log of a pod" in { k8s => - k8s.create(getNginxPod(podName, "1.7.9")).valueT + k8s.create(getNginxPod(podName, "1.27.0")).valueT Thread.sleep(3000) eventually(timeout(30.seconds), interval(3.seconds)) { val source = k8s.getPodLogSource(podName, LogQueryParams(follow = Some(false))).futureValue diff --git a/client/src/it/scala/skuber/PodSpec.scala b/client/src/it/scala/skuber/PodSpec.scala index 2b5bbbea..696b3725 100644 --- a/client/src/it/scala/skuber/PodSpec.scala +++ b/client/src/it/scala/skuber/PodSpec.scala @@ -30,13 +30,13 @@ class PodSpec extends K8SFixture with Eventually with Matchers with BeforeAndAft it should "create a pod" in { k8s => val podName1: String = randomUUID().toString - val p = k8s.create(getNginxPod(podName1, "1.7.9")).valueT + val p = k8s.create(getNginxPod(podName1, "1.27.0")).valueT p.name shouldBe podName1 } it should "get the newly created pod" in { k8s => val podName2: String = randomUUID().toString - k8s.create(getNginxPod(podName2, "1.7.9")).valueT + k8s.create(getNginxPod(podName2, "1.27.0")).valueT eventually(timeout(30.seconds), interval(3.seconds)) { val p = k8s.get[Pod](podName2).valueT p.name shouldBe podName2 @@ -45,7 +45,7 @@ class PodSpec extends K8SFixture with Eventually with Matchers with BeforeAndAft it should "check for newly created pod and container to be ready" in { k8s => val podName3: String = randomUUID().toString - k8s.create(getNginxPod(podName3, "1.7.9")).valueT + k8s.create(getNginxPod(podName3, "1.27.0")).valueT eventually(timeout(20.seconds), interval(3.seconds)) { val podRetrieved = k8s.get[Pod](podName3).valueT val podStatus = podRetrieved.status.get @@ -73,7 +73,7 @@ class PodSpec extends K8SFixture with Eventually with Matchers with BeforeAndAft it should "delete a pod" in { k8s => val podName4: String = randomUUID().toString - k8s.create(getNginxPod(podName4, "1.7.9")).valueT + k8s.create(getNginxPod(podName4, "1.27.0")).valueT k8s.delete[Pod](podName4).valueT whenReady(k8s.get[Namespace](podName4).withTimeout().failed) { result => @@ -88,8 +88,8 @@ class PodSpec extends K8SFixture with Eventually with Matchers with BeforeAndAft it should "delete selected pods" in { k8s => val podName5: String = randomUUID().toString + "-foo" val podName6: String = randomUUID().toString + "-bar" - k8s.create(getNginxPod(podName5, "1.7.9", labels = Map("foo" -> "1"))).valueT - k8s.create(getNginxPod(podName6, "1.7.9", labels = Map("bar" -> "2"))).valueT + k8s.create(getNginxPod(podName5, "1.27.0", labels = Map("foo" -> "1"))).valueT + k8s.create(getNginxPod(podName6, "1.27.0", labels = Map("bar" -> "2"))).valueT Thread.sleep(5000) k8s.deleteAllSelected[PodList](LabelSelector(LabelSelector.ExistsRequirement("foo"))).valueT diff --git a/client/src/it/scala/skuber/WatchContinuouslySpec.scala b/client/src/it/scala/skuber/WatchContinuouslySpec.scala index 25d4855f..1be86caf 100644 --- a/client/src/it/scala/skuber/WatchContinuouslySpec.scala +++ b/client/src/it/scala/skuber/WatchContinuouslySpec.scala @@ -43,8 +43,8 @@ // it should "continuously watch changes on a resource - deployments" in { k8s => // import skuber.api.client.EventType // -// val deploymentOne = getNginxDeployment(deployment1, "1.7.9") -// val deploymentTwo = getNginxDeployment(deployment2, "1.7.9") +// val deploymentOne = getNginxDeployment(deployment1, "1.27.0") +// val deploymentTwo = getNginxDeployment(deployment2, "1.27.0") // // val stream = k8s.list[DeploymentList].withTimeout().map { l => // k8s.watchAllContinuously[Deployment](Some(l.resourceVersion)) @@ -106,7 +106,7 @@ // it should "continuously watch changes on a named resource obj from the beginning - deployment" in { k8s => // import skuber.api.client.EventType // -// val deployment = getNginxDeployment(deployment3, "1.7.9") +// val deployment = getNginxDeployment(deployment3, "1.27.0") // // k8s.create(deployment).valueT.name shouldBe deployment3 // eventually { @@ -155,7 +155,7 @@ // it should "continuously watch changes on a named resource from the beginning - deployment" in { k8s => // import skuber.api.client.EventType // -// val deployment = getNginxDeployment(deployment4, "1.7.9") +// val deployment = getNginxDeployment(deployment4, "1.27.0") // // k8s.create(deployment).valueT.name shouldBe deployment4 // eventually { @@ -200,7 +200,7 @@ // // createNamespace(namespace5, k8s) // -// val deployment = getNginxDeployment(deployment5, "1.7.9") +// val deployment = getNginxDeployment(deployment5, "1.27.0") // // k8s.create(deployment, Some(namespace5)).valueT.name shouldBe deployment5 // eventually { diff --git a/client/src/it/scala/skuber/format/PodFormatSpec.scala b/client/src/it/scala/skuber/format/PodFormatSpec.scala index ed876b00..9ce112a3 100644 --- a/client/src/it/scala/skuber/format/PodFormatSpec.scala +++ b/client/src/it/scala/skuber/format/PodFormatSpec.scala @@ -27,7 +27,7 @@ class PodFormatSpec extends K8SFixture with Eventually with Matchers with Before val namePrefix: String = "foo-" val podName: String = namePrefix + randomUUID().toString val containerName = "nginx" - val nginxVersion = "1.7.9" + val nginxVersion = "1.27.0" val nginxImage = s"nginx:$nginxVersion" val podJsonStr = s""" diff --git a/client/src/test/resources/exampleNode.json b/client/src/test/resources/exampleNode.json index c21f4bef..0868af55 100644 --- a/client/src/test/resources/exampleNode.json +++ b/client/src/test/resources/exampleNode.json @@ -114,7 +114,7 @@ { "names": [ "nginx@sha256:e3456c851a152494c3e4ff5fcc26f240206abac0c9d794affb40e0714846c451", - "nginx:1.7.9" + "nginx:1.27.0" ], "sizeBytes": 91664166 }, diff --git a/client/src/test/resources/exampleStatefulSet.json b/client/src/test/resources/exampleStatefulSet.json index 0b97ce11..9ce52047 100644 --- a/client/src/test/resources/exampleStatefulSet.json +++ b/client/src/test/resources/exampleStatefulSet.json @@ -36,7 +36,7 @@ { "imagePullPolicy": "Always", "name": "nginx", - "image": "nginx:1.7.9", + "image": "nginx:1.27.0", "ports": [ { "containerPort": 80 diff --git a/client/src/test/scala/skuber/apps/DeploymentSpec.scala b/client/src/test/scala/skuber/apps/DeploymentSpec.scala index 4c7a9d16..3137129b 100644 --- a/client/src/test/scala/skuber/apps/DeploymentSpec.scala +++ b/client/src/test/scala/skuber/apps/DeploymentSpec.scala @@ -90,7 +90,7 @@ class DeploymentSpec extends Specification { } }, "name": "nginx", - "image": "nginx:1.7.9", + "image": "nginx:1.27.0", "ports": [ { "containerPort": 80 diff --git a/client/src/test/scala/skuber/apps/v1/DeploymentSpec.scala b/client/src/test/scala/skuber/apps/v1/DeploymentSpec.scala index 39f7f6ed..b2404723 100644 --- a/client/src/test/scala/skuber/apps/v1/DeploymentSpec.scala +++ b/client/src/test/scala/skuber/apps/v1/DeploymentSpec.scala @@ -82,7 +82,7 @@ class DeploymentSpec extends Specification { "containers": [ { "name": "nginx", - "image": "nginx:1.7.9", + "image": "nginx:1.27.0", "ports": [ { "containerPort": 80 diff --git a/client/src/test/scala/skuber/ext/DeploymentSpec.scala b/client/src/test/scala/skuber/ext/DeploymentSpec.scala index 771170ce..1c4c6f70 100644 --- a/client/src/test/scala/skuber/ext/DeploymentSpec.scala +++ b/client/src/test/scala/skuber/ext/DeploymentSpec.scala @@ -82,7 +82,7 @@ class DeploymentSpec extends Specification { "containers": [ { "name": "nginx", - "image": "nginx:1.7.9", + "image": "nginx:1.27.0", "ports": [ { "containerPort": 80 diff --git a/client/src/test/scala/skuber/json/EndpointsFormatSpec.scala b/client/src/test/scala/skuber/json/EndpointsFormatSpec.scala index c7a7adc1..e60cb77d 100644 --- a/client/src/test/scala/skuber/json/EndpointsFormatSpec.scala +++ b/client/src/test/scala/skuber/json/EndpointsFormatSpec.scala @@ -4,7 +4,7 @@ import org.specs2.mutable.Specification // for unit-style testing import org.specs2.execute.Result import org.specs2.execute.Failure import org.specs2.execute.Success - +import skuber.json.format.endpointFmt import scala.math.BigInt import java.util.Calendar diff --git a/client/src/test/scala/skuber/json/NamespaceFormatSpec.scala b/client/src/test/scala/skuber/json/NamespaceFormatSpec.scala index 781918e5..baf0d44e 100644 --- a/client/src/test/scala/skuber/json/NamespaceFormatSpec.scala +++ b/client/src/test/scala/skuber/json/NamespaceFormatSpec.scala @@ -1,5 +1,6 @@ package skuber.json - +import skuber.json.format.namespaceFormat +import skuber.json.format.nsSpecFormat import org.specs2.mutable.Specification // for unit-style testing import org.specs2.execute.Result import org.specs2.execute.Failure diff --git a/client/src/test/scala/skuber/json/NodeFormatSpec.scala b/client/src/test/scala/skuber/json/NodeFormatSpec.scala index 52aaf0c6..f49a54e0 100644 --- a/client/src/test/scala/skuber/json/NodeFormatSpec.scala +++ b/client/src/test/scala/skuber/json/NodeFormatSpec.scala @@ -1,5 +1,5 @@ package skuber.json - +import skuber.json.format.nodeFmt import org.specs2.mutable.Specification import org.specs2.execute.Result import org.specs2.execute.Failure @@ -14,7 +14,7 @@ import format._ import play.api.libs.json._ import scala.io.Source - +import skuber.json.format.nodeListFmt /** * @author David O'Riordan */ diff --git a/client/src/test/scala/skuber/json/ReplicationControllerFormatSpec.scala b/client/src/test/scala/skuber/json/ReplicationControllerFormatSpec.scala index 38149f91..7c89e7ce 100644 --- a/client/src/test/scala/skuber/json/ReplicationControllerFormatSpec.scala +++ b/client/src/test/scala/skuber/json/ReplicationControllerFormatSpec.scala @@ -14,7 +14,7 @@ import skuber._ import format._ import play.api.libs.json._ - +import skuber.json.format.repCtrlrFormat /** diff --git a/client/src/test/scala/skuber/json/ServiceFormatSpec.scala b/client/src/test/scala/skuber/json/ServiceFormatSpec.scala index fd70c6b9..8ac39dcb 100644 --- a/client/src/test/scala/skuber/json/ServiceFormatSpec.scala +++ b/client/src/test/scala/skuber/json/ServiceFormatSpec.scala @@ -14,7 +14,7 @@ import skuber._ import format._ import play.api.libs.json._ - +import skuber.json.format.serviceFmt /** diff --git a/docs/README.md b/docs/README.md index 86ee69de..01f3ef21 100644 --- a/docs/README.md +++ b/docs/README.md @@ -478,7 +478,7 @@ The following example emulates that described [here](http://kubernetes.io/docs/u Initial creation of the deployment: ```scala val nginxLabel = "app" -> "nginx" -val nginxContainer = Container("nginx",image="nginx:1.7.9").exposePort(80) +val nginxContainer = Container("nginx",image="nginx:1.27.0").exposePort(80) val nginxTemplate = Pod.Template.Spec .named("nginx") @@ -620,7 +620,7 @@ object DynamicKubernetesClientImplExample extends App { "containers": [ { "name": "nginx", - "image": "nginx:1.7.9", + "image": "nginx:1.27.0", "ports": [ { "containerPort": 80, diff --git a/examples/src/main/scala/skuber/examples/deployment/DeploymentExamples.scala b/examples/src/main/scala/skuber/examples/deployment/DeploymentExamples.scala index 6a73a308..b3e11cc1 100644 --- a/examples/src/main/scala/skuber/examples/deployment/DeploymentExamples.scala +++ b/examples/src/main/scala/skuber/examples/deployment/DeploymentExamples.scala @@ -15,7 +15,7 @@ import scala.concurrent.duration._ * * The steps it executes are: * - * 1. Create a deployment of nginx version 1.7.9 + * 1. Create a deployment of nginx version 1.27.0 * 2. Waits a little to allow initial deployment to complete * 3. Update the deployment to nginx version 1.9.1 * @@ -33,7 +33,7 @@ object DeploymentExamples extends App { val k8s = k8sInit - val deployment = deployNginx("1.7.9") + val deployment = deployNginx("1.27.0") deployment.foreach { depl => @@ -48,7 +48,7 @@ object DeploymentExamples extends App { // Initial pull of nginx images is likely to be greatest delay val waitingTime = 60 // seconds - println("Successfully created deployment of nginx 1.7.9...now waiting " + waitingTime + " seconds before updating it") + println("Successfully created deployment of nginx 1.27.0...now waiting " + waitingTime + " seconds before updating it") val reportInterval = 10 // seconds for (i <- 1 to (waitingTime/reportInterval)) { diff --git a/examples/src/main/scala/skuber/examples/dynamicClient/DynamicKubernetesClientImplExample.scala b/examples/src/main/scala/skuber/examples/dynamicClient/DynamicKubernetesClientImplExample.scala index 31851d3c..99e8c124 100644 --- a/examples/src/main/scala/skuber/examples/dynamicClient/DynamicKubernetesClientImplExample.scala +++ b/examples/src/main/scala/skuber/examples/dynamicClient/DynamicKubernetesClientImplExample.scala @@ -42,7 +42,7 @@ object DynamicKubernetesClientImplExample extends App { "containers": [ { "name": "nginx", - "image": "nginx:1.7.9", + "image": "nginx:1.27.0", "ports": [ { "containerPort": 80,