From 90f2257365505a1f1d872bb774f7844e90c978d7 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Mon, 26 Feb 2024 19:41:19 -0700 Subject: [PATCH] Return err if open fails: Returning the error will ensure the provider is removed from future calls. --- providers/openbmc/openbmc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/openbmc/openbmc.go b/providers/openbmc/openbmc.go index 7a00737b..f2de939f 100644 --- a/providers/openbmc/openbmc.go +++ b/providers/openbmc/openbmc.go @@ -115,7 +115,7 @@ func New(host, user, pass string, log logr.Logger, opts ...Option) *Conn { // Open a connection to a BMC via redfish func (c *Conn) Open(ctx context.Context) (err error) { if err := c.deviceSupported(ctx); err != nil { - return nil + return err } if err := c.redfishwrapper.Open(ctx); err != nil {