volcano-sh / volcano

A Cloud Native Batch System (Project under CNCF)
https://volcano.sh
Apache License 2.0
4.11k stars 949 forks source link

Fix staticcheck warnings on cmd and example #3720

Open xovoxy opened 2 weeks ago

xovoxy commented 2 weeks ago

What type of PR is this?

/kind feature

What this PR does / why we need it:

fix staticcheck warnings on cmd and example, warnings like this

cmd/controller-manager/app/server.go:84:9: opt.LockObjectNamespace is deprecated: use ResourceNamespace instead.  (SA1019)
cmd/controller-manager/app/server.go:85:42: opt.LockObjectNamespace is deprecated: use ResourceNamespace instead.  (SA1019)
cmd/scheduler/app/server.go:117:9: opt.LockObjectNamespace is deprecated: use ResourceNamespace instead.  (SA1019)
cmd/scheduler/app/server.go:118:42: opt.LockObjectNamespace is deprecated: use ResourceNamespace instead.  (SA1019)
cmd/webhook-manager/app/util.go:49:13: wait.Poll is deprecated: This method does not return errors from context, use PollUntilContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release.  (SA1019)
cmd/webhook-manager/app/util.go:82:13: wait.Poll is deprecated: This method does not return errors from context, use PollUntilContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release.  (SA1019)
example/extender/extender.go:28:5: var snapshot is unused (U1000)

Which issue(s) this PR fixes:

Parts of https://github.com/volcano-sh/volcano/issues/3713

volcano-sh-bot commented 2 weeks ago

Welcome @xovoxy!

It looks like this is your first PR to volcano-sh/volcano.

Thank you, and welcome to Volcano. :smiley:

xovoxy commented 2 weeks ago

hi @hwdef, i fix the staticcheck warnings, could you have a look? thanks~ /assign @hwdef

xovoxy commented 2 weeks ago

/ok-to-test By the way, this PR is too long. If it can be split into multiple parts, it may be more convenient to review.

ohh right, let me split it~

volcano-sh-bot commented 2 weeks ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign hwdef You can assign the PR to them by writing /assign @hwdef in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/volcano-sh/volcano/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment