Overwrite scalyr api key if the relevant env variable is present in the operator pod

This commit is contained in:
Sergey Dudoladov 2018-01-12 14:56:14 +01:00
parent 56359d23c9
commit ec6799f34a
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package controller
import (
"fmt"
"os"
"sync"
"github.com/Sirupsen/logrus"
@ -107,6 +108,11 @@ func (c *Controller) initOperatorConfig() {
}
c.opConfig = config.NewFromMap(configMapData)
scalyrAPIKey := os.Getenv("SCALYR_API_KEY")
if scalyrAPIKey != "" {
c.opConfig.ScalyrAPIKey = scalyrAPIKey
}
}
func (c *Controller) initController() {