Skip to content

Commit 09beeec

Browse files
report hostname to bcdb, #784 (#801)
1 parent ff0b129 commit 09beeec

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

cmds/identityd/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,19 @@ func registerNode(nodeID pkg.Identifier, farmID pkg.FarmID, version string, stor
459459

460460
publicKeyHex := hex.EncodeToString(base58.Decode(nodeID.Identity()))
461461

462+
hostName, err := os.Hostname()
463+
if err != nil {
464+
hostName = "unknown"
465+
}
466+
462467
uptime, err := hostUptime()
463468
if err != nil {
464469
return errors.Wrap(err, "could not get node uptime")
465470
}
466471

467472
err = store.NodeRegister(directory.Node{
468473
NodeId: nodeID.Identity(),
474+
HostName: hostName,
469475
NodeIdV1: v1ID,
470476
FarmId: int64(farmID),
471477
OsVersion: version,

go.mod

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.13
44

55
require (
66
github.com/BurntSushi/toml v0.3.1
7+
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
78
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412
89
github.com/alexflint/go-filemutex v0.0.0-20171028004239-d358565f3c3f
910
github.com/blang/semver v3.5.1+incompatible
@@ -15,22 +16,28 @@ require (
1516
github.com/containernetworking/plugins v0.8.4
1617
github.com/deckarep/golang-set v1.7.1
1718
github.com/dgrijalva/jwt-go v3.2.0+incompatible
19+
github.com/docker/distribution v2.7.1+incompatible // indirect
20+
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
1821
github.com/firecracker-microvm/firecracker-go-sdk v0.19.1-0.20200110212531-741fc8cb0f2e
1922
github.com/fsnotify/fsnotify v1.4.7
2023
github.com/gizak/termui/v3 v3.1.0
24+
github.com/go-ole/go-ole v1.2.4 // indirect
2125
github.com/go-redis/redis v6.15.5+incompatible
2226
github.com/gomodule/redigo v2.0.0+incompatible
2327
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf
2428
github.com/google/uuid v1.1.1
2529
github.com/imdario/mergo v0.3.9 // indirect
2630
github.com/jbenet/go-base58 v0.0.0-20150317085156-6237cf65f3a6
31+
github.com/opencontainers/image-spec v1.0.1 // indirect
32+
github.com/opencontainers/runc v0.1.1 // indirect
2733
github.com/opencontainers/runtime-spec v1.0.1
2834
github.com/pkg/errors v0.9.1
2935
github.com/rs/zerolog v1.18.0
3036
github.com/shirou/gopsutil v2.19.11+incompatible
3137
github.com/stretchr/testify v1.5.1
38+
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 // indirect
3239
github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae
33-
github.com/threefoldtech/tfexplorer v0.3.1-0.20200520102753-5af0aaa729ab
40+
github.com/threefoldtech/tfexplorer v0.3.1-0.20200526075254-c1a0c9828e65
3441
github.com/threefoldtech/zbus v0.1.3
3542
github.com/urfave/cli v1.22.3
3643
github.com/vishvananda/netlink v1.0.0
@@ -44,4 +51,4 @@ require (
4451
gotest.tools v2.2.0+incompatible
4552
)
4653

47-
replace github.com/docker/distribution v2.7.1+incompatible => github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible
54+
replace github.com/docker/distribution v2.7.1+incompatible => github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,8 @@ github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG
559559
github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae h1:vgGSvdW5Lqg+I1aZOlG32uyE6xHpLdKhZzcTEktz5wM=
560560
github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae/go.mod h1:quDq6Se6jlGwiIKia/itDZxqC5rj6/8OdFyMMAwTxCs=
561561
github.com/threefoldtech/tfexplorer v0.2.5/go.mod h1:TugylEDgMNKk4ZIzee9PpVmIcLNLaRLdiXuhHTt/AR0=
562-
github.com/threefoldtech/tfexplorer v0.3.1-0.20200520102753-5af0aaa729ab h1:ScS48/VSgl3Eu25XGtex4z7ylGxc1KhHVyIRNc1LbmQ=
563-
github.com/threefoldtech/tfexplorer v0.3.1-0.20200520102753-5af0aaa729ab/go.mod h1:ozAe2OYR4ALp2PtyKT1A6UiTI+0ZcFU2UfUaRd1P5eE=
562+
github.com/threefoldtech/tfexplorer v0.3.1-0.20200526075254-c1a0c9828e65 h1:lOl3CzIxus08mIT8gaw2qCx2wxVS4xDgnINYz1l06YE=
563+
github.com/threefoldtech/tfexplorer v0.3.1-0.20200526075254-c1a0c9828e65/go.mod h1:oFtPBaRLW4c6YuEfTrWYzAGw+wb6I4+og133zjDOYP0=
564564
github.com/threefoldtech/zbus v0.1.3 h1:18DnIzximRbATle5ZdZz0i84n/bCYB8k/gkhr2dXayc=
565565
github.com/threefoldtech/zbus v0.1.3/go.mod h1:ZtiRpcqzEBJetVQDsEbw0p48h/AF3O1kf0tvd30I0BU=
566566
github.com/threefoldtech/zos v0.2.4-rc2/go.mod h1:7A2oflcmSVsHFC4slOcydWgJyFBMFMH9wsaTRv+CnTA=

0 commit comments

Comments
 (0)