-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Cleanup Kubelet static analysis issues #81206
Cleanup Kubelet static analysis issues #81206
Conversation
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.
Cool stuff @tallclair!
Overall, love this direction and after a brief skim, all the changes look like the increase code quality.
Just to confirm, staticcheck
doesn't actually address the errors correct? It just identifies them?
Would be interested to know ballpark how long it took you to make the fixes for pkg/kubelet/...
.
/test pull-kubernetes-e2e-gce-storage-slow |
@mattjmcnaughton Right, it doesn't address them, you have to manually clean up. I don't have a good estimate because I was multitasking and going back and forth with tweaking the staticcheck script, but my guess is about 1-2 hours. My workflow was to paste the staticcheck errors into emacs, which lets me quickly open each file at the triggered line, which sped it up a lot. I think most editors support that format? |
On Fri, Aug 09, 2019 at 10:41:06AM -0700, Tim Allclair (St. Clair) wrote:
@mattjmcnaughton Right, it doesn't address them, you have to manually clean up. I don't have a good estimate because I was multitasking and going back and forth with tweaking the staticcheck script, but my guess is about 1-2 hours. My workflow was to paste the staticcheck errors into emacs, which lets me quickly open each file at the triggered line, which sped it up a lot. I think most editors support that format?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#81206 (comment)
Cool stuff, thanks!
|
This looks great! Let me know if this is ready for review. |
44b91e3
to
c257a25
Compare
/hold cancel Ready for review! |
c257a25
to
4fe50cf
Compare
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.
/lgtm
good stuff :)
definitely think it makes sense to merge this as soon as possible, before we start getting duplicate prs for fixes in kubelet.
/test pull-kubernetes-kubemark-e2e-gce-big |
/assign @vishh |
@@ -253,7 +253,7 @@ func (g *GenericPLEG) relist() { | |||
needsReinspection[pid] = pod | |||
|
|||
continue | |||
} else if _, found := g.podsToReinspect[pid]; found { | |||
} else { |
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.
Why removing the condition?
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.
delete
is a no-op if the element isn't in the map, so the condition is redundant.
pkg/kubelet/remote/utils.go
Outdated
} | ||
|
||
if status.CreatedAt == 0 { | ||
return fmt.Errorf("CreatedAt is not set") | ||
return fmt.Errorf("createdAt is not set") |
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 know we want the error messages to start with a lower-case letter, but changing the variable name for this is weird....
I'm okay with this since adding exceptions may not be worth it.
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.
Woops, this was just me not paying enough attention to my find-replace. We're actually not using this check, it was more an experiment to see what applying it here would do. Given that, I just reverted this file.
4fe50cf
to
af8e4d6
Compare
af8e4d6
to
b3f8671
Compare
Rebased. Picked up some new failures from #81434, but I opted to just keep them on the blacklist and follow up with a separate PR. Hoping we can merge this quickly to avoid treading water with new failures... For |
On Wed, Aug 21, 2019 at 11:02:56AM -0700, Tim Allclair (St. Clair) wrote:
Rebased. Picked up some new failures from #81434, but I opted to just keep them on the blacklist and follow up with a separate PR.
Hoping we can merge this quickly to avoid treading water with new failures...
For `hack/.staticcheckfailures` approval:
/assign @BenTheElder
(Should we expand the approvers set for the blacklist files?)
--
You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub:
#81206 (comment)
Yeah, big +1 to try to get these types of diffs merged as soon as possible :)
Thanks for leading the charge on this - exciting stuff!
|
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, tallclair The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Cleanup the
pkg/kubelet/...
issues identified by staticcheck in #81189Which issue(s) this PR fixes:
#36858
Special notes for your reviewer:
Used to validate the options in #81189. Feel free to wait for 81189 to merge first before reviewing.
/hold
Does this PR introduce a user-facing change?:
/sig node
/priority important-longterm
/assign @yujuhong