diff options
author | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-03-28 12:53:13 -0700 |
---|---|---|
committer | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2019-04-03 15:31:31 -0700 |
commit | f74ad24c6034294c1915f5778adb259dd65c9208 (patch) | |
tree | 03cf8ba86d1f966b9a342b325bd2fb36bf1dcc59 /src/k8splugin/cmd/main.go | |
parent | e97d3fddc255b73f87a8b3dbd8fa505e34247504 (diff) |
Refactor instance code
Issue-ID: MULTICLOUD-350
Change-Id: I2574d94e4ebada1e138913b2a03549dd90906d7b
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/cmd/main.go')
-rw-r--r-- | src/k8splugin/cmd/main.go | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/k8splugin/cmd/main.go b/src/k8splugin/cmd/main.go index e0e715be..e600c0d6 100644 --- a/src/k8splugin/cmd/main.go +++ b/src/k8splugin/cmd/main.go @@ -15,35 +15,29 @@ package main import ( "context" - "flag" "log" + "math/rand" "net/http" "os" "os/signal" - "path/filepath" - - "github.com/gorilla/handlers" - "k8s.io/client-go/util/homedir" + "time" "k8splugin/api" utils "k8splugin/internal" + + "github.com/gorilla/handlers" ) func main() { - var kubeconfig string - - home := homedir.HomeDir() - if home != "" { - kubeconfig = *flag.String("kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file") - } - flag.Parse() err := utils.CheckInitialSettings() if err != nil { log.Fatal(err) } - httpRouter := api.NewRouter(kubeconfig, nil, nil) + rand.Seed(time.Now().UnixNano()) + + httpRouter := api.NewRouter(nil, nil, nil) loggedRouter := handlers.LoggingHandler(os.Stdout, httpRouter) log.Println("Starting Kubernetes Multicloud API") |