Skip to content

Commit fd5c9b3

Browse files
eed3si9nktoso
authored andcommitted
Fixes Kubernetes API Revolved value (#223)
Fixes #222 The `Revolved` record expects the service name, but the Kubernetes API discovery's `Resolved` record currently returns the label selector instead of the queried service name. This causes Lagom to fail on startup on Kubernetes with a strange error. ``` akka.actor.ActorSystemImpl [sourceThread=application-akka.actor.default-dispatcher-3, akkaTimestamp=xxxx, akkaSource=akka.actor.ActorSystemImpl(application), sourceActorSystem=application] - Kubernetes API entity: [{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"found '=', expected: ',' or 'end of string'","reason":"BadRequest","code":400} ``` This is likely caused by querying `app=app=foo`.
1 parent a489147 commit fd5c9b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

discovery-kubernetes-api/src/main/scala/akka/discovery/kubernetes/KubernetesApiSimpleServiceDiscovery.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ class KubernetesApiSimpleServiceDiscovery(system: ActorSystem) extends SimpleSer
9494
unmarshalled
9595
}
9696

97-
} yield Resolved(labelSelector, targets(podList, settings.podPortName, settings.podNamespace, settings.podDomain))
97+
} yield
98+
Resolved(
99+
serviceName = name,
100+
addresses = targets(podList, settings.podPortName, settings.podNamespace, settings.podDomain)
101+
)
98102

99103
private def apiToken() =
100104
FileIO.fromPath(Paths.get(settings.apiTokenPath)).runFold("")(_ + _.utf8String).recover { case _: Throwable => "" }

0 commit comments

Comments
 (0)