+
Skip to content
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
5 changes: 4 additions & 1 deletion client/src/main/scala/skuber/Service.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ case class Service(
def withClusterIP(ip: String) = this.copy(spec = Some(copySpec.copy(clusterIP = ip)))
def withType(_type: Service.Type.Value) = this.copy(spec = Some(copySpec.copy(_type = _type)))
def withLoadBalancerType = withType(Service.Type.LoadBalancer)
def withLoadBalancerIP(ip: String) = this.copy(spec = Some(copySpec.copy(loadBalancerIP = ip)))

def withExternalIP(ip: String) = this.copy(spec = Some(copySpec.copy(externalIPs = List(ip))))
def withExternalIPs(ips: List[String]) = this.copy(spec = Some(copySpec.copy(externalIPs = ips)))
Expand Down Expand Up @@ -108,7 +109,9 @@ object Service {
_type: ServiceType=ClusterIP,
externalIPs: List[String] = List(),
externalName: String = "",
sessionAffinity: Affinity.Affinity = Affinity.None)
sessionAffinity: Affinity.Affinity = Affinity.None,
loadBalancerIP: String = ""
)
{
def withSelector(sel: Map[String, String]) : Spec = this.copy(selector = sel)
def withSelector(sel: Tuple2[String,String]): Spec = withSelector(Map(sel))
Expand Down
3 changes: 2 additions & 1 deletion client/src/main/scala/skuber/json/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,8 @@ package object format {
(JsPath \ "type").formatEnum(Service.Type, Some(Service.Type.ClusterIP)) and
(JsPath \ "externalIPs").formatMaybeEmptyList[String] and
(JsPath \ "externalName").formatMaybeEmptyString() and
(JsPath \ "sessionAffinity").formatEnum(Service.Affinity, Some(Service.Affinity.None))
(JsPath \ "sessionAffinity").formatEnum(Service.Affinity, Some(Service.Affinity.None)) and
(JsPath \ "loadBalancerIP").formatMaybeEmptyString()
)(Service.Spec.apply _, unlift(Service.Spec.unapply))

implicit val serviceFmt: Format[Service] = (
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载