score-spec / score-compose

Reference implementation for docker-compose target platform support
https://score.dev/
Apache License 2.0
445 stars 40 forks source link

fix: set workload network hostname to workload name #121

Closed astromechza closed 4 months ago

astromechza commented 4 months ago

@mathieu-benoit and I were trying to get a Score adaption of https://github.com/Azure-Samples/aks-store-demo/tree/main working with score-compose but found that a routing configuration assumed that the hostname was equal to the workload name. However score compose was using (workload name)-(1st container name) because it shares the network of the 1st container.

This PR fixes this by setting the hostname directly on the 1st container as appropriate.

This shouldn't break compatibility and should make things more readable when workloads only contain one container.