X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4b4458cfb9dbc2f80ab819efcb1533fcff8f6503..4659594d40987a2bab1ff75d015de5d46113692d:/services/health/main.go diff --git a/services/health/main.go b/services/health/main.go index b6358deefc..21fcf4d674 100644 --- a/services/health/main.go +++ b/services/health/main.go @@ -1,22 +1,38 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + package main import ( "flag" + "fmt" "net/http" "git.curoverse.com/arvados.git/sdk/go/arvados" "git.curoverse.com/arvados.git/sdk/go/health" "git.curoverse.com/arvados.git/sdk/go/httpserver" - log "github.com/Sirupsen/logrus" + 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.") flag.Parse() + // Print version information if requested + if *getVersion { + fmt.Printf("arvados-health %s\n", version) + return + } + log.SetFormatter(&log.JSONFormatter{ TimestampFormat: "2006-01-02T15:04:05.000000000Z07:00", }) + log.Printf("arvados-health %s started", version) + cfg, err := arvados.GetConfig(*configFile) if err != nil { log.Fatal(err) @@ -25,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) }