63 lines
2.4 KiB
Diff
63 lines
2.4 KiB
Diff
From 81053917083b7776ec39172823f7a4f954363ec1 Mon Sep 17 00:00:00 2001
|
|
From: Sebastiaan van Stijn <github@gone.nl>
|
|
Date: Wed, 21 Aug 2024 15:38:52 +0200
|
|
Subject: [PATCH 107/172] libnetwork: fix non-constant format string in call
|
|
(govet)
|
|
|
|
libnetwork/controller.go:1054:32: printf: non-constant format string in call to github.com/docker/docker/libnetwork/types.NotFoundErrorf (govet)
|
|
return types.NotFoundErrorf(err.Error())
|
|
^
|
|
libnetwork/controller.go:1073:32: printf: non-constant format string in call to github.com/docker/docker/libnetwork/types.NotFoundErrorf (govet)
|
|
return types.NotFoundErrorf(err.Error())
|
|
^
|
|
libnetwork/sandbox_externalkey_unix.go:113:21: printf: non-constant format string in call to fmt.Errorf (govet)
|
|
return fmt.Errorf(string(buf[0:n]))
|
|
^
|
|
|
|
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
|
|
(cherry picked from commit 6008c42ca2903467964c430c0030a29ae4cc858e)
|
|
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
|
|
---
|
|
libnetwork/controller.go | 4 ++--
|
|
libnetwork/sandbox_externalkey_unix.go | 2 +-
|
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/libnetwork/controller.go b/libnetwork/controller.go
|
|
index bcbbdd06ca..8341946756 100644
|
|
--- a/libnetwork/controller.go
|
|
+++ b/libnetwork/controller.go
|
|
@@ -1045,7 +1045,7 @@ func (c *Controller) loadDriver(networkType string) error {
|
|
|
|
if err != nil {
|
|
if errors.Cause(err) == plugins.ErrNotFound {
|
|
- return types.NotFoundErrorf(err.Error())
|
|
+ return types.NotFoundErrorf("%v", err)
|
|
}
|
|
return err
|
|
}
|
|
@@ -1064,7 +1064,7 @@ func (c *Controller) loadIPAMDriver(name string) error {
|
|
|
|
if err != nil {
|
|
if errors.Cause(err) == plugins.ErrNotFound {
|
|
- return types.NotFoundErrorf(err.Error())
|
|
+ return types.NotFoundErrorf("%v", err)
|
|
}
|
|
return err
|
|
}
|
|
diff --git a/libnetwork/sandbox_externalkey_unix.go b/libnetwork/sandbox_externalkey_unix.go
|
|
index 7534421141..32b1027bb4 100644
|
|
--- a/libnetwork/sandbox_externalkey_unix.go
|
|
+++ b/libnetwork/sandbox_externalkey_unix.go
|
|
@@ -94,7 +94,7 @@ func processReturn(r io.Reader) error {
|
|
return fmt.Errorf("failed to read buf in processReturn : %v", err)
|
|
}
|
|
if string(buf[0:n]) != success {
|
|
- return fmt.Errorf(string(buf[0:n]))
|
|
+ return fmt.Errorf("%s", buf[0:n])
|
|
}
|
|
return nil
|
|
}
|
|
--
|
|
2.27.0
|
|
|