Skip to content

Commit 6c57529

Browse files
authored
[Bugfix] Fix Operator Logger NPE (#1011)
1 parent 43ce623 commit 6c57529

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- (Feature) OPS CLI with Arango Task
1515
- (Bugfix) Allow ArangoBackup Creation during Upload state
1616
- (Hotfix) Fix `ArangoDeployment` SubResource in CRD auto-installer
17+
- (Bugfix) Fix Operator Logger NPE
1718

1819
## [1.2.13](https://github.com/arangodb/kube-arangodb/tree/1.2.13) (2022-06-07)
1920
- (Bugfix) Fix arangosync members state inspection

pkg/operator/operator.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ const (
6363
initRetryWaitTime = 30 * time.Second
6464
)
6565

66+
var logger = logging.Global().RegisterAndGetLogger("operator", logging.Info)
67+
6668
type operatorV2type string
6769

6870
const (
@@ -129,6 +131,7 @@ func NewOperator(config Config, deps Dependencies) (*Operator, error) {
129131
deploymentReplications: make(map[string]*replication.DeploymentReplication),
130132
localStorages: make(map[string]*storage.LocalStorage),
131133
}
134+
o.log = logger.WrapObj(o)
132135
return o, nil
133136
}
134137

@@ -311,3 +314,7 @@ func (o *Operator) onStartOperatorV2(operatorType operatorV2type, stop <-chan st
311314

312315
<-stop
313316
}
317+
318+
func (o *Operator) WrapLogger(in *zerolog.Event) *zerolog.Event {
319+
return in.Str("namespace", o.Namespace)
320+
}

0 commit comments

Comments
 (0)