refactor: use --watch-config instead of signaling the container to reload config
This commit is contained in:
@@ -244,11 +244,6 @@ func DockerInspect(containerOrImageID, format string) (output string, err error)
|
||||
return
|
||||
}
|
||||
|
||||
// DockerSignal sends a given signal (in string form) to a docker container
|
||||
func DockerSignal(containerID, signal string) (err error) {
|
||||
return sh.Command(DockerBin(), "kill", fmt.Sprintf("--signal=%s", signal), containerID).Run()
|
||||
}
|
||||
|
||||
// IsImageHerokuishBased returns true if app image is based on herokuish
|
||||
func IsImageHerokuishBased(image string, appName string) bool {
|
||||
output, err := DockerInspect(image, "{{range .Config.Env}}{{if eq . \"USER=herokuishuser\" }}{{println .}}{{end}}{{end}}")
|
||||
|
||||
@@ -74,7 +74,7 @@ func startVectorContainer(vectorImage string) error {
|
||||
"--volume", "/var/run/docker.sock:/var/run/docker.sock",
|
||||
"--volume", common.MustGetEnv("DOKKU_LOGS_HOST_DIR") + ":/var/logs/dokku/apps",
|
||||
vectorImage,
|
||||
"--config", "/etc/vector/vector.json"}, " "))
|
||||
"--config", "/etc/vector/vector.json", "--watch-config"}, " "))
|
||||
|
||||
if !cmd.Execute() {
|
||||
return errors.New("Unable to start vector container")
|
||||
@@ -222,11 +222,5 @@ func writeVectorConfig() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if !common.ContainerExists(vectorContainerName) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return common.SuppressOutput(func() error {
|
||||
return common.DockerSignal(vectorContainerName, "HUP")
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user