Skip to content

Commit

Permalink
image/build: use "nolint" comment to work around gosec regression
Browse files Browse the repository at this point in the history
Latest gosec linter has a regression in parsing "nosec" comments;
see securego/gosec#1046

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Oct 23, 2023
1 parent 594aeb3 commit 5e84fd5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cli/command/image/build/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,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
if resp, err = http.Get(url); err != nil {
if resp, err = http.Get(url); err != nil { //nolint:gosec // Ignore G107: Potential HTTP request made with variable url
return nil, err
}
if resp.StatusCode < http.StatusBadRequest {
Expand Down

0 comments on commit 5e84fd5

Please sign in to comment.