-
Notifications
You must be signed in to change notification settings - Fork 813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update golangci-lint to 1.18, add bodyclose check #1051
Conversation
Build Succeeded 👏 Build Id: 834fbf51-0b51-4fb1-8fed-bcb92b9b2ec5 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all of the missing closes were in tests, I think we should hold this PR until after the 1.0 release is cut.
test/e2e/allocator_test.go
Outdated
@@ -82,7 +82,7 @@ func TestAllocator(t *testing.T) { | |||
return true, err | |||
} | |||
|
|||
response, err = client.Post(requestURL, "application/json", bytes.NewBuffer(body)) | |||
response, err = client.Post(requestURL, "application/json", bytes.NewBuffer(body)) // nolint: bodyclose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like this one should be fixed to actually close the body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I got an issue with golangci-lint 1.17.1 had false positive on that line. Will check with 1.18 version from this PR, they have updated bodyclose
.
pkg/util/apiserver/apiserver.go
Outdated
@@ -108,13 +108,12 @@ func NewAPIServer(mux *http.ServeMux) *APIServer { | |||
// e.g. http://localhost:8001/apis/scheduling.k8s.io/v1beta1 | |||
// as well as registering a CRDHandler that all http requests for the given APIResource are routed to | |||
func (as *APIServer) AddAPIResource(groupVersion string, resource metav1.APIResource, handler CRDHandler) { | |||
list, ok := as.resourceList[groupVersion] | |||
_, ok := as.resourceList[groupVersion] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the changes in this file. Should this be included? It doesn't have anything to do with fixing the lint errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was included because it contains gocritic
appendAssign
issue. Well I can move it into another PR. I mentioned this file in description to this PR. Different variables in the left side and in the parameters to append.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this change from PR.
Now that 1.0 has been cut, can you address comments so that we can get this merged? Thanks! |
bab7841
to
3b9f33c
Compare
Build Succeeded 👏 Build Id: b57a4f6e-0c23-440d-a38e-1e584c278da7 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Fix some test which leaks connections.
3b9f33c
to
6deb5b9
Compare
There was a need to rewrite |
Build Succeeded 👏 Build Id: e89736b6-a1af-4f23-b52f-92f26f355463 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aLekSer, markmandel The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fix some tests which leak connections (
bodyclose
linter).This version of
golangci-lint
would be needed for upgrading to Golang 1.13.Fixed also: