[
https://issues.apache.org/jira/browse/YUNIKORN-1497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17651773#comment-17651773
]
Wu hsuang zong commented on YUNIKORN-1497:
------------------------------------------
Hello, I have solved related problems before, so I assigned this issue to
myself.
However, I did not see related errors when I used `golangci-lint run`, I would
like to know how to reproduce this log ?
The following is the result of running `golangci-lint run` in
/yunikorn-k8shim/pkg/cache
{code:java}
/yunikorn-k8shim/pkg/cache$ golangci-lint run{code}
{code:java}
context_recovery.go:72: Function 'recover' is too long (138 > 120) (funlen)
func (ctx *Context) recover(mgr []interfaces.Recoverable, due time.Duration)
error {
node_coordinator_test.go:39: Function 'TestUpdatePod' has too many statements
(113 > 80) (funlen)
func TestUpdatePod(t *testing.T) {
task_test.go:452: Function 'TestHandleSubmitTaskEvent' is too long (123 > 120)
(funlen)
func TestHandleSubmitTaskEvent(t *testing.T) {
application.go:107:34: string `no transition` has 3 occurrences, make it a
constant (goconst)
if err != nil && err.Error() != "no transition" {
^
application_test.go:450:10: string `testUUID001` has 3 occurrences, make it a
constant (goconst)
UUID := "testUUID001"
^
context_test.go:158:12: string `app00002` has 3 occurrences, make it a constant
(goconst)
appID2 := "app00002"
^
application_test.go:536:11: string `app00001` has 5 occurrences, but such
constant `appID` already exists (goconst)
appID := "app00001"
^
application_test.go:169:11: string `app-test-001` has 6 occurrences, but such
constant `appID` already exists (goconst)
appID := "app-test-001"
^
application.go:572: application.go:572: Line contains TODO/BUG/FIXME: "TODO app
lifecycle updates" (godox)
// TODO app lifecycle updates
task.go:579:19: func `(*Task).enterState` is unused (unused)
func (task *Task) enterState(event *fsm.Event) {
^
context_test.go:387:2: ineffectual assignment to found (ineffassign)
found, ok := context.schedulerCache.GetPod("UID-00001") {code}
> fix lint error in pkg/cache/context.go
> --------------------------------------
>
> Key: YUNIKORN-1497
> URL: https://issues.apache.org/jira/browse/YUNIKORN-1497
> Project: Apache YuniKorn
> Issue Type: Improvement
> Components: shim - kubernetes
> Reporter: Wilfred Spiegelenburg
> Assignee: Wu hsuang zong
> Priority: Minor
> Labels: newbie
>
> The linter shows an error on the context.go file:
> {code:java}
> pkg/cache/context.go:323:2: var `clusterId` should be `clusterID` (golint)
> clusterId := ctx.apiProvider.GetAPIs().Conf.ClusterID
> ^{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]