From 2224187f1b15ab396859b7fa3b4efa470a9c3ec1 Mon Sep 17 00:00:00 2001 From: Kevin Petremann Date: Tue, 20 Feb 2024 15:27:25 +0100 Subject: [PATCH] refactor: peer group is now optional Peer group support is deprecated in AFK. We keep them only to help to migrate. --- internal/convertor/device/device.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/convertor/device/device.go b/internal/convertor/device/device.go index 7f7af72..55a4752 100644 --- a/internal/convertor/device/device.go +++ b/internal/convertor/device/device.go @@ -14,6 +14,7 @@ import ( "github.com/criteo/data-aggregation-api/internal/model/dcim" "github.com/criteo/data-aggregation-api/internal/model/openconfig" "github.com/openconfig/ygot/ygot" + "github.com/rs/zerolog/log" ) const AFKEnabledTag = "afk-enabled" @@ -73,7 +74,7 @@ func NewDevice(dcimInfo *dcim.NetworkDevice, devicesData *repository.AssetsPerDe device.PeerGroups, ok = devicesData.PeerGroups[dcimInfo.Hostname] if !ok { - return nil, fmt.Errorf("no peer-groups found for %s", dcimInfo.Hostname) + log.Warn().Msgf("no peer-groups found for %s", dcimInfo.Hostname) } device.PrefixLists, ok = devicesData.PrefixLists[dcimInfo.Hostname]