Skip to content

Commit

Permalink
[release 16.18.6] Format code before release
Browse files Browse the repository at this point in the history
  • Loading branch information
otoroshi-bot-github-actions committed Jul 25, 2024
1 parent d659348 commit a336684
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions otoroshi/app/plugins/jobs/kubernetes/client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ class KubernetesClient(val config: KubernetesConfig, env: Env) {
cert
} else {
Try(new String(Base64.getDecoder.decode(cert), StandardCharsets.UTF_8)) match {
case Failure(e) => cert
case Failure(e) => cert
case Success(decodedCert) => decodedCert
}
}
}
val caCert = Cert.apply("kubernetes-ca-cert", decoded, "").copy(id = "kubernetes-ca-cert")
val caCert = Cert.apply("kubernetes-ca-cert", decoded, "").copy(id = "kubernetes-ca-cert")
DynamicSSLEngineProvider.certificates.find { case (k, c) =>
c.id == "kubernetes-ca-cert"
} match {
Expand Down
11 changes: 6 additions & 5 deletions otoroshi/app/plugins/jobs/kubernetes/config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ object KubernetesConfig {
},
caCert =
(json \ "clusters").as[JsArray].value.find(v => (v \ "name").as[String] == currentContextCluster).map {
defaultUser => {
val base64Cert = (defaultUser \ "cluster" \ "certificate-authority-data").as[String]
val cert = new String(Base64.getDecoder.decode(base64Cert), StandardCharsets.UTF_8)
cert
}
defaultUser =>
{
val base64Cert = (defaultUser \ "cluster" \ "certificate-authority-data").as[String]
val cert = new String(Base64.getDecoder.decode(base64Cert), StandardCharsets.UTF_8)
cert
}
},
namespaces = (conf \ "namespaces").asOpt[Seq[String]].filter(_.nonEmpty).getOrElse(Seq("*")),
namespacesLabels = (conf \ "namespacesLabels").asOpt[Map[String, String]].getOrElse(Map.empty),
Expand Down

0 comments on commit a336684

Please sign in to comment.