Skip to content

Commit 73f8fad

Browse files
authored
[Bugfix] Fix NPE in state fetcher (#936)
1 parent 6712304 commit 73f8fad

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ vendor/
88
deps/
99
.vscode/
1010
**/*.enterprise.go
11-
**/*.enterprise.go
1211
**/enterprise/**
1312
enterprise.mk
1413
local/

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- (Feature) Allow to restart DBServers in cases when WriteConcern will be satisfied
1111
- (Feature) Allow to configure action timeouts
1212
- (Feature) (AT) Add ArangoTask API
13+
- (Bugfix) Fix NPE in State fetcher
1314

1415
## [1.2.8](https://github.com/arangodb/kube-arangodb/tree/1.2.8) (2022-02-24)
1516
- Do not check License V2 on Community images

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ require (
2828
github.com/arangodb/go-driver v1.2.1
2929
github.com/arangodb/go-driver/v2 v2.0.0-20211021031401-d92dcd5a4c83
3030
github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21
31-
github.com/arangodb/rebalancer v0.1.1
3231
github.com/cenkalti/backoff v2.2.1+incompatible
3332
github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9
3433
github.com/ghodss/yaml v1.0.0

pkg/deployment/member/state.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,17 @@ func (s *stateInspector) RefreshState(ctx context.Context, members api.Deploymen
125125
} else {
126126
cs.Version = v
127127
}
128-
}
129128

130-
hctx, cancel := globals.GetGlobalTimeouts().ArangoDCheck().WithTimeout(ctx)
131-
defer cancel()
132-
if cluster, err := c.Cluster(hctx); err != nil {
133-
h.Error = err
134-
} else {
135-
if health, err := cluster.Health(hctx); err != nil {
129+
hctx, cancel := globals.GetGlobalTimeouts().ArangoDCheck().WithTimeout(ctx)
130+
defer cancel()
131+
if cluster, err := c.Cluster(hctx); err != nil {
136132
h.Error = err
137133
} else {
138-
h.Members = health.Health
134+
if health, err := cluster.Health(hctx); err != nil {
135+
h.Error = err
136+
} else {
137+
h.Members = health.Health
138+
}
139139
}
140140
}
141141

0 commit comments

Comments
 (0)