Skip to content

Upgrade the Kubernetes client minor version. #5275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ class KubernetesClient(
case e =>
transid.failed(this, start, s"Failed create pod for '$name': ${e.getClass} - ${e.getMessage}", ErrorLevel)
//log pod events to diagnose pod readiness failures
val podEvents = kubeRestClient.events
val podEvents = kubeRestClient
.v1()
.events()
.inNamespace(namespace)
.withField("involvedObject.name", name)
.list()
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ gradle.ext.akka_http = [version : '10.2.4']
gradle.ext.akka_management = [version : '1.0.5']

gradle.ext.curator = [version : '4.0.0']
gradle.ext.kube_client = [version: '4.4.2']
gradle.ext.kube_client = [version: '4.10.3']
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,21 @@ class WhiskPodBuilderTests extends FlatSpec with Matchers with KubeClientSupport
withClue(Serialization.asYaml(pod)) {
val c = getActionContainer(pod)
//min cpu is: config.millicpus
c.getResources.getLimits.asScala.get("cpu").map(_.getAmount) shouldBe Some("300m")
c.getResources.getLimits.asScala.get("cpu").map(_.getAmount) shouldBe Some("300")
}

val (pod2, _) = builder.buildPodSpec(name, testImage, 15.MB, Map("foo" -> "bar"), Map("fooL" -> "barV"), config)
withClue(Serialization.asYaml(pod2)) {
val c = getActionContainer(pod2)
//max cpu is: config.maxMillicpus
c.getResources.getLimits.asScala.get("cpu").map(_.getAmount) shouldBe Some("1000m")
c.getResources.getLimits.asScala.get("cpu").map(_.getAmount) shouldBe Some("1000")
}

val (pod3, _) = builder.buildPodSpec(name, testImage, 7.MB, Map("foo" -> "bar"), Map("fooL" -> "barV"), config)
withClue(Serialization.asYaml(pod3)) {
val c = getActionContainer(pod3)
//scaled cpu is: action mem/config.mem x config.maxMillicpus
c.getResources.getLimits.asScala.get("cpu").map(_.getAmount) shouldBe Some("600m")
c.getResources.getLimits.asScala.get("cpu").map(_.getAmount) shouldBe Some("600")
}

val config2 = KubernetesClientConfig(
Expand Down Expand Up @@ -139,8 +139,8 @@ class WhiskPodBuilderTests extends FlatSpec with Matchers with KubeClientSupport
val (pod, _) = builder.buildPodSpec(name, testImage, 2.MB, Map("foo" -> "bar"), Map("fooL" -> "barV"), config)
withClue(Serialization.asYaml(pod)) {
val c = getActionContainer(pod)
c.getResources.getLimits.asScala.get("ephemeral-storage").map(_.getAmount) shouldBe Some("1024Mi")
c.getResources.getRequests.asScala.get("ephemeral-storage").map(_.getAmount) shouldBe Some("1024Mi")
c.getResources.getLimits.asScala.get("ephemeral-storage").map(_.getAmount) shouldBe Some("1024")
c.getResources.getRequests.asScala.get("ephemeral-storage").map(_.getAmount) shouldBe Some("1024")
}
}

Expand Down Expand Up @@ -222,8 +222,8 @@ class WhiskPodBuilderTests extends FlatSpec with Matchers with KubeClientSupport
new EnvVar("foo", "bar", null),
new EnvVar("POD_UID", null, new EnvVarSource(null, new ObjectFieldSelector(null, "metadata.uid"), null, null))))

c.getResources.getLimits.asScala.get("memory").map(_.getAmount) shouldBe Some("10Mi")
c.getResources.getLimits.asScala.get("cpu").map(_.getAmount) shouldBe Some("900m")
c.getResources.getLimits.asScala.get("memory").map(_.getAmount) shouldBe Some("10")
c.getResources.getLimits.asScala.get("cpu").map(_.getAmount) shouldBe Some("900")
c.getSecurityContext.getCapabilities.getDrop.asScala should contain allOf ("NET_RAW", "NET_ADMIN")
c.getPorts.asScala.find(_.getName == "action").map(_.getContainerPort) shouldBe Some(8080)
c.getImage shouldBe testImage
Expand Down