mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-29 14:39:40 +02:00
## Summary Currently you can either run a single service or all-in-one mode. This PR adds support for running any 2 or 3 services together. For example `services: authorize,proxy`. I think I updated the conditions to make sense, but there's some risk here as there may have been some assumptions in places I'm overlooking. ## Related issues - [ENG-2485](https://linear.app/pomerium/issue/ENG-2485/core-support-running-multiple-but-not-all-services) ## Checklist - [x] reference any related issues - [x] updated unit tests - [x] add appropriate label (`enhancement`, `bug`, `breaking`, `dependencies`, `ci`) - [x] ready for review
15 lines
395 B
Go
15 lines
395 B
Go
package telemetry
|
|
|
|
import "strings"
|
|
|
|
// ServiceName turns a pomerium service option into the appropriate external label for telemetry purposes
|
|
//
|
|
// Ex:
|
|
// service 'all' -> 'pomerium'
|
|
// service 'proxy' -> 'pomerium-proxy'
|
|
func ServiceName(service string) string {
|
|
if strings.Count(service, ",") > 0 || service == "all" || service == "" {
|
|
return "pomerium"
|
|
}
|
|
return "pomerium-" + service
|
|
}
|