diff --git a/sztp-agent/Dockerfile b/sztp-agent/Dockerfile index 86c33d2..c728366 100644 --- a/sztp-agent/Dockerfile +++ b/sztp-agent/Dockerfile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright (c) 2022 Dell Inc, or its subsidiaries. -FROM docker.io/library/golang:1.22.4-alpine AS builder +FROM docker.io/library/golang:1.22.4-alpine as builder WORKDIR /app diff --git a/sztp-agent/pkg/dhcp/dbus.go b/sztp-agent/pkg/dhcp/dbus.go index 1220839..5f7a1ef 100644 --- a/sztp-agent/pkg/dhcp/dbus.go +++ b/sztp-agent/pkg/dhcp/dbus.go @@ -19,7 +19,7 @@ import ( func GetBootstrapURLsViaNetworkManager() ([]string, error) { conn, err := dbus.SystemBus() if err != nil { - panic(fmt.Errorf("failed to connect to system bus: %v", err)) + return nil, fmt.Errorf("failed to connect to system bus: %v", err) } // Get NetworkManager object @@ -28,7 +28,7 @@ func GetBootstrapURLsViaNetworkManager() ([]string, error) { var activeConnPaths []dbus.ObjectPath err = nm.Call("org.freedesktop.DBus.Properties.Get", 0, "org.freedesktop.NetworkManager", "ActiveConnections").Store(&activeConnPaths) if err != nil { - panic(fmt.Errorf("failed to get ActiveConnections property: %v", err)) + return nil, fmt.Errorf("failed to get ActiveConnections property: %v", err) } log.Println("[INFO] active connection paths: ", activeConnPaths) diff --git a/sztp-agent/pkg/secureagent/daemon.go b/sztp-agent/pkg/secureagent/daemon.go index 906d4b1..6bea027 100644 --- a/sztp-agent/pkg/secureagent/daemon.go +++ b/sztp-agent/pkg/secureagent/daemon.go @@ -55,7 +55,7 @@ func (a *Agent) performBootstrapSequence() error { urls := a.GetBootstrapURL() log.Println("[INFO] Performing the Bootstrap Sequence on each URL") for _, url := range urls { - urlCopy := url + urlCopy := url // found no other way to escape golangci-lint err = a.doRequestBootstrapServerOnboardingInfo(&urlCopy) if err != nil { log.Println("[ERROR] ", err.Error())