-
Notifications
You must be signed in to change notification settings - Fork 965
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
Fix staticcheck warnings on cmd and example #3720
Conversation
Welcome @xovoxy! |
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.
/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~ |
d933a3a
to
42d2778
Compare
example/extender/extender.go
Outdated
@@ -21,6 +21,7 @@ import ( | |||
"io" | |||
"net/http" | |||
|
|||
"k8s.io/klog" |
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.
Currently volcano should be using v2?
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.
done
42d2778
to
2efa109
Compare
2efa109
to
ade8ca5
Compare
/ok-to-test |
@@ -49,6 +50,7 @@ func onSessionOpen(w http.ResponseWriter, r *http.Request) { | |||
NamespaceInfo: req.NamespaceInfo, | |||
RevocableNodes: req.RevocableNodes, | |||
} | |||
klog.V(4).Infof("the snapshot of cluster %+v", *snapshot) |
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 add this?
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.
example/extender/extender.go:28:5: var snapshot is unused (U1000)
add this code to avoid staticcheck warnings, or delete the field. i think adding a log for this is better. if you have a better method, can tell me.
cmd/webhook-manager/app/util.go
Outdated
@@ -46,7 +46,7 @@ func addCaCertForWebhook(kubeClient *kubernetes.Clientset, service *router.Admis | |||
var mutatingWebhookName = volcanoAdmissionPrefix + strings.ReplaceAll(service.Path, "/", "-") | |||
var mutatingWebhook *v1.MutatingWebhookConfiguration | |||
webhookChanged := false | |||
if err := wait.Poll(time.Second, 5*time.Minute, func() (done bool, err error) { | |||
if err := wait.PollUntilContextTimeout(context.Background(), time.Second, 5*time.Minute, false, func(_ context.Context) (done bool, err error) { |
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.
How about set the immediate to true?
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.
alright, setting immediate to true more closely aligns with the behavior of wait.Poll, i have changed it.
Signed-off-by: xovoxy <[email protected]>
ade8ca5
to
9d1a5f7
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hwdef 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 feature
What this PR does / why we need it:
fix staticcheck warnings on cmd and example, warnings like this
Which issue(s) this PR fixes:
Parts of #3713