mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-01 19:36:32 +02:00
* envoy: add support for hot-reloading bootstrap configuration * use passed in log level * fix unnecessary firstNonEmpty * move process release to after new command start
31 lines
433 B
Go
31 lines
433 B
Go
package envoy
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"strconv"
|
|
)
|
|
|
|
const baseIDPath = "/tmp/pomerium-envoy-base-id"
|
|
|
|
func firstNonEmpty(args ...string) string {
|
|
for _, a := range args {
|
|
if a != "" {
|
|
return a
|
|
}
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func readBaseID() (int, bool) {
|
|
bs, err := ioutil.ReadFile(baseIDPath)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
baseID, err := strconv.Atoi(string(bs))
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return baseID, true
|
|
}
|