Skip to content

Commit

Permalink
fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
franckrasolo committed Oct 8, 2023
1 parent ac22f6b commit 287ba02
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions example/src/main/kotlin/example.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import dev.forkhandles.k8s.extensions.backend
import dev.forkhandles.k8s.extensions.metadata
import dev.forkhandles.k8s.extensions.newIngress
import dev.forkhandles.k8s.extensions.spec
import io.fabric8.kubernetes.api.model.IntOrString
import dev.forkhandles.k8s.networking.v1.defaultBackend
import dev.forkhandles.k8s.networking.v1.metadata
import dev.forkhandles.k8s.networking.v1.newIngress
import dev.forkhandles.k8s.networking.v1.newServiceBackendPort
import dev.forkhandles.k8s.networking.v1.service
import dev.forkhandles.k8s.networking.v1.spec
import io.fabric8.kubernetes.client.ConfigBuilder
import io.fabric8.kubernetes.client.KubernetesClientBuilder

Expand All @@ -11,15 +12,19 @@ fun main() {
.withConfig(ConfigBuilder().withNamespace("default").build())
.build()

client.extensions().ingresses().resource(
client.network().v1().ingresses().resource(
newIngress {
metadata {
name = "example-ingress"
}
spec {
backend {
serviceName = "example-service"
servicePort = IntOrString(8080)
defaultBackend {
service {
name = "example-service"
port = newServiceBackendPort {
number = 8080
}
}
}
}
}
Expand Down

0 comments on commit 287ba02

Please sign in to comment.