Merge branch 'master' into 13804-no-shutdown-wanted-nodes
[arvados.git] / services / health / main.go
index d04b55bc6c1a111b5ad5c1b8418dcddf131fe4e0..1d2ec47a6af41d39907d62105fcb898e462ff82a 100644 (file)
@@ -1,18 +1,22 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
 package main
 
 import (
        "flag"
        "fmt"
        "net/http"
-       "os"
 
        "git.curoverse.com/arvados.git/sdk/go/arvados"
        "git.curoverse.com/arvados.git/sdk/go/health"
        "git.curoverse.com/arvados.git/sdk/go/httpserver"
-       arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
        log "github.com/Sirupsen/logrus"
 )
 
+var version = "dev"
+
 func main() {
        configFile := flag.String("config", arvados.DefaultConfigFile, "`path` to arvados configuration file")
        getVersion := flag.Bool("version", false, "Print version information and exit.")
@@ -20,14 +24,14 @@ func main() {
 
        // Print version information if requested
        if *getVersion {
-               fmt.Printf("Version: %s\n", arvadosVersion.GetVersion())
-               os.Exit(0)
+               fmt.Printf("arvados-health %s\n", version)
+               return
        }
 
        log.SetFormatter(&log.JSONFormatter{
                TimestampFormat: "2006-01-02T15:04:05.000000000Z07:00",
        })
-       log.Printf("arvados health %q started", arvadosVersion.GetVersion())
+       log.Printf("arvados-health %s started", version)
 
        cfg, err := arvados.GetConfig(*configFile)
        if err != nil {
@@ -37,7 +41,7 @@ func main() {
        if err != nil {
                log.Fatal(err)
        }
-       nodeCfg, err := clusterCfg.GetThisSystemNode()
+       nodeCfg, err := clusterCfg.GetNodeProfile("")
        if err != nil {
                log.Fatal(err)
        }