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