Skip to content

Commit

Permalink
Fixes Kubernetes API Revolved value (#223)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
eed3si9n authored and ktoso committed Jun 27, 2018
1 parent a489147 commit fd5c9b3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ class KubernetesApiSimpleServiceDiscovery(system: ActorSystem) extends SimpleSer
unmarshalled
}

} yield Resolved(labelSelector, targets(podList, settings.podPortName, settings.podNamespace, settings.podDomain))
} yield
Resolved(
serviceName = name,
addresses = targets(podList, settings.podPortName, settings.podNamespace, settings.podDomain)
)

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

0 comments on commit fd5c9b3

Please sign in to comment.