From 5e5ccaa82997bca156000a38ff0e6c1121dec188 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 10 Jun 2024 21:17:52 +0200 Subject: [PATCH] cli/command/image/build: fix nosec comment Looks like it's broken, so use a blanket "nolint:gosec" instead; cli/command/image/build/context.go:238:17: G107: Potential HTTP request made with variable url (gosec) if resp, err = http.Get(url); err != nil { ^ Signed-off-by: Sebastiaan van Stijn (cherry picked from commit df474d5176b8aa8645c76b2f1b50e969a729c1b9) Signed-off-by: Cory Snider --- cli/command/image/build/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/command/image/build/context.go b/cli/command/image/build/context.go index 7131372f5f..a02d23c6b7 100644 --- a/cli/command/image/build/context.go +++ b/cli/command/image/build/context.go @@ -231,7 +231,7 @@ func GetContextFromURL(out io.Writer, remoteURL, dockerfileName string) (io.Read // getWithStatusError does an http.Get() and returns an error if the // status code is 4xx or 5xx. func getWithStatusError(url string) (resp *http.Response, err error) { - // #nosec G107 -- Ignore G107: Potential HTTP request made with variable url + //nolint:gosec // Ignore G107: Potential HTTP request made with variable url if resp, err = http.Get(url); err != nil { return nil, err }