From 327fe3c9a63425f3fbba2915fa761ee22119ad55 Mon Sep 17 00:00:00 2001 From: Markus Vahlenkamp Date: Thu, 8 Jun 2023 16:38:18 +0200 Subject: [PATCH] allow for zero length partial config (#1423) --- nodes/vr_sros/vr-sros.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nodes/vr_sros/vr-sros.go b/nodes/vr_sros/vr-sros.go index 76952582e6..d915f3b8f1 100644 --- a/nodes/vr_sros/vr-sros.go +++ b/nodes/vr_sros/vr-sros.go @@ -192,6 +192,16 @@ func (s *vrSROS) applyPartialConfig(ctx context.Context, addr, platformName, use var err error var d *network.Driver + configContent, err := utils.ReadFileContent(configFile) + if err != nil { + return err + } + + // check file contains content, otherwise exit early + if len(strings.TrimSpace(string(configContent))) == 0 { + return nil + } + for loop := true; loop; { if !s.isHealthy(ctx) { time.Sleep(5 * time.Second) // cool-off period