Skip to content

Commit 475987a

Browse files
authored
[Bugfix] Fix Rebalancer NPE in case if member is missing in Status (#1236)
1 parent 36a2a73 commit 475987a

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- (Feature) Add Generics & Drop policy/v1beta1 support
55
- (Feature) Add Kubernetes Client logger
66
- (Feature) CreationFailed ArangoMember Phase
7+
- (Bugfix) Fix Rebalancer NPE in case if member is missing in Status
78

89
## [1.2.24](https://github.com/arangodb/kube-arangodb/tree/1.2.24) (2023-01-25)
910
- (Bugfix) Fix deployment creation on ARM64

pkg/util/arangod/conn/closed.go

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package conn
22+
23+
import (
24+
"context"
25+
26+
"github.com/arangodb/go-driver"
27+
)
28+
29+
func NewClosedConnection() driver.Connection {
30+
return closedConnection{}
31+
}
32+
33+
func newClosedConnectionError() error {
34+
return closedConnectionError{}
35+
}
36+
37+
type closedConnectionError struct {
38+
}
39+
40+
func (c closedConnectionError) Error() string {
41+
return "Connection Closed"
42+
}
43+
44+
type closedConnection struct {
45+
}
46+
47+
func (c closedConnection) NewRequest(method, path string) (driver.Request, error) {
48+
return nil, newClosedConnectionError()
49+
}
50+
51+
func (c closedConnection) Do(ctx context.Context, req driver.Request) (driver.Response, error) {
52+
return nil, newClosedConnectionError()
53+
}
54+
55+
func (c closedConnection) Unmarshal(data driver.RawObject, result interface{}) error {
56+
return newClosedConnectionError()
57+
}
58+
59+
func (c closedConnection) Endpoints() []string {
60+
return nil
61+
}
62+
63+
func (c closedConnection) UpdateEndpoints(endpoints []string) error {
64+
return newClosedConnectionError()
65+
}
66+
67+
func (c closedConnection) SetAuthentication(authentication driver.Authentication) (driver.Connection, error) {
68+
return c, nil
69+
}
70+
71+
func (c closedConnection) Protocols() driver.ProtocolSet {
72+
return nil
73+
}

0 commit comments

Comments
 (0)