Include review comments

This commit is contained in:
Sergey Dudoladov 2018-02-13 15:51:12 +01:00
parent 5b0e2ea66d
commit dc4229e84d
1 changed files with 3 additions and 4 deletions

View File

@ -2,9 +2,9 @@ package main
import (
"flag"
"io/ioutil"
"log"
"os"
"os/exec"
"os/signal"
"sync"
"syscall"
@ -28,8 +28,7 @@ func init() {
flag.BoolVar(&config.NoTeamsAPI, "noteamsapi", false, "Disable all access to the teams API")
flag.Parse()
cmd := exec.Command("cat", "/var/run/secrets/kubernetes.io/serviceaccount/namespace")
operatorNamespaceBytes, err := cmd.Output()
operatorNamespaceBytes, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
if err != nil {
log.Fatalf("Unable to detect operator namespace from within its pod due to %v", err)
}
@ -43,7 +42,7 @@ func init() {
err := config.ConfigMapName.Decode(namespacedConfigMapName)
if err != nil {
log.Fatalf("incorrect config map name")
log.Fatalf("incorrect config map name: %v", namespacedConfigMapName)
}
}