Skip to content

Commit

Permalink
Upgrade mill-scalafix
Browse files Browse the repository at this point in the history
  • Loading branch information
joan38 committed Oct 9, 2023
1 parent 338d9b2 commit 533ffab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import $ivy.`com.goyeau::mill-git::0.2.5`
import $ivy.`com.goyeau::mill-scalafix::0.2.11`
import $ivy.`com.goyeau::mill-scalafix::0.3.1`
import $ivy.`org.typelevel::scalac-options:0.1.4`

import $file.project.Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ private[client] class NamespacedPodsApi[F[_]](
stderr: Boolean = true,
tty: Boolean = false
): F[WSRequest] = {
val uri = (webSocketAddress.resolve(resourceUri) / podName / "exec")
.+?("stdin" -> stdin.toString)
.+?("stdout" -> stdout.toString)
.+?("stderr" -> stderr.toString)
.+?("tty" -> tty.toString)
.+??("container" -> container)
.++?("command" -> commands)
val uri = (webSocketAddress.resolve(resourceUri) / podName / "exec") +?
("stdin" -> stdin.toString) +?
("stdout" -> stdout.toString) +?
("stderr" -> stderr.toString) +?
("tty" -> tty.toString) +??
("container" -> container) ++?
("command" -> commands)

WSRequest(uri, method = Method.POST)
.withOptionalAuthorization(authorization)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ object SslContexts {
sslContext
}

@SuppressWarnings(Array("scalafix:DisableSyntax.asInstanceOf"))
private def keyManagers[F[_]](config: KubeConfig[F]) = {
// Client certificate
val certDataStream = config.clientCertData.map(data => new ByteArrayInputStream(Base64.getDecoder.decode(data)))
Expand All @@ -38,11 +39,11 @@ object SslContexts {
} yield {
Security.addProvider(new BouncyCastleProvider())
val pemKeyPair =
new PEMParser(new InputStreamReader(keyStream)).readObject().asInstanceOf[PEMKeyPair] // scalafix:ok
new PEMParser(new InputStreamReader(keyStream)).readObject().asInstanceOf[PEMKeyPair]
val privateKey = new JcaPEMKeyConverter().setProvider("BC").getPrivateKey(pemKeyPair.getPrivateKeyInfo)

val certificateFactory = CertificateFactory.getInstance("X509")
val certificate = certificateFactory.generateCertificate(certStream).asInstanceOf[X509Certificate] // scalafix:ok
val certificate = certificateFactory.generateCertificate(certStream).asInstanceOf[X509Certificate]

defaultKeyStore.setKeyEntry(
certificate.getSubjectX500Principal.getName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import org.http4s.Uri

object Uris {
def addLabels(labels: Map[String, String], uri: Uri): Uri =
if (labels.nonEmpty) uri.+?("labelSelector" -> labels.map { case (k, v) => s"$k=$v" }.mkString(","))
if (labels.nonEmpty) uri +? ("labelSelector" -> labels.map { case (k, v) => s"$k=$v" }.mkString(","))
else uri
}

0 comments on commit 533ffab

Please sign in to comment.