Fix keepalive notification intervals
@@ -472,6 +472,9 @@ func createRegistrationEvent(entity *corev2.Entity) *corev2.Event {
func (k *Keepalived) alive(state store.OperatorState) {
KeepalivesProcessed.WithLabelValues(KeepaliveCounterLabelAlive).Inc()
+
+ if logrus.GetLevel() == logrus.DebugLevel {
+ // avoid unnecessary allocations here
lager := logger.WithFields(logrus.Fields{
"present": true,
"entity": state.Name,
@@ -480,11 +483,6 @@ func (k *Keepalived) alive(state store.OperatorState) {
lager.Debug("entity is alive")
}
-
-type Metadata struct {
- WarningTimeout int64 `json:"warn"`
- CriticalTimeout int64 `json:"crit"`
- Interval int64 `json:"intr"`
}
func (k *Keepalived) handleNotification(ctx context.Context, state store.OperatorState) error {
@@ -558,7 +556,7 @@ func (k *Keepalived) handleNotification(ctx context.Context, state store.Operato
return err
}
- var meta Metadata
+ var meta agentMetadata
if err := json.Unmarshal(*state.Metadata, &meta); err != nil {
lager.WithError(err).Error("error reading state metadata")
return err
