diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d663426..5ed6f76 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,16 @@ updates: labels: - "release-note-none" open-pull-requests-limit: 10 +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + labels: + - "release-note-none" + groups: + actions: + update-types: + - "major" + - "minor" + - "patch" diff --git a/.golangci.yml b/.golangci.yml index 2be1714..507e711 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,7 @@ --- run: concurrency: 6 - deadline: 10m + timeout: 10m linters: disable-all: true enable: @@ -9,8 +9,10 @@ linters: - asciicheck - bidichk - bodyclose + - canonicalheader - containedctx - contextcheck + - copyloopvar - decorder - dogsled - dupl @@ -20,9 +22,9 @@ linters: - errchkjson - errname - errorlint - - execinquery - exhaustive - exportloopref + - fatcontext - forbidigo - forcetypeassert - gci @@ -51,7 +53,8 @@ linters: - inamedparam - ineffassign - interfacebloat - - logrlint + - intrange + - loggercheck - maintidx - makezero - mirror @@ -94,14 +97,14 @@ linters: - zerologlint # - cyclop # - depguard + # - err113 # - exhaustruct # - funlen # - gocognit - # - goerr113 - # - gomnd # - gosec # - ireturn # - lll + # - mnd # - nlreturn # - nonamedreturns # - tagliatelle @@ -117,109 +120,4 @@ linters-settings: nestif: min-complexity: 10 gocritic: - enabled-checks: - - appendAssign - - appendCombine - - argOrder - - assignOp - - badCall - - badCond - - badLock - - badRegexp - - badSorting - - badSyncOnceFunc - - boolExprSimplify - - builtinShadow - - builtinShadowDecl - - captLocal - - caseOrder - - codegenComment - - commentFormatting - - commentedOutCode - - commentedOutImport - - defaultCaseOrder - - deferInLoop - - deferUnlambda - - deprecatedComment - - docStub - - dupArg - - dupBranchBody - - dupCase - - dupImport - - dupSubExpr - - dynamicFmtString - - elseif - - emptyDecl - - emptyFallthrough - - emptyStringTest - - equalFold - - evalOrder - - exitAfterDefer - - exposedSyncMutex - - externalErrorReassign - - filepathJoin - - flagDeref - - flagName - - hexLiteral - - httpNoBody - - hugeParam - - ifElseChain - - importShadow - - indexAlloc - - initClause - - mapKey - - methodExprCall - - nestingReduce - - newDeref - - nilValReturn - - octalLiteral - - offBy1 - - paramTypeCombine - - preferDecodeRune - - preferFilepathJoin - - preferFprint - - preferStringWriter - - preferWriteByte - - ptrToRefParam - - rangeExprCopy - - rangeValCopy - - redundantSprint - - regexpMust - - regexpPattern - - regexpSimplify - - returnAfterHttpError - - ruleguard - - singleCaseSwitch - - sliceClear - - sloppyLen - - sloppyReassign - - sloppyTypeAssert - - sortSlice - - sprintfQuotedString - - sqlQuery - - stringConcatSimplify - - stringXbytes - - stringsCompare - - switchTrue - - syncMapLoadAndDelete - - timeExprSimplify - - todoCommentWithoutDetail - - tooManyResultsChecker - - truncateCmp - - typeAssertChain - - typeDefFirst - - typeSwitchVar - - typeUnparen - - uncheckedInlineErr - - underef - - unlabelStmt - - unlambda - - unnamedResult - - unnecessaryBlock - - unnecessaryDefer - - unslice - - valSwap - - weakCond - - whyNoLint - - wrapperFunc - - yodaStyleExpr + enable-all: true diff --git a/Makefile b/Makefile index d937cfd..e9f34ef 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ BUILD_INFO := $(shell date +%s) BUILD_PATH := $(shell pwd)/build GOLANGCI_LINT := ${BUILD_PATH}/golangci-lint -GOLANGCI_LINT_VERSION := v1.56.2 +GOLANGCI_LINT_VERSION := v1.59.1 # If GOPATH not specified, use one in the local directory ifeq ($(GOPATH),) diff --git a/go.mod b/go.mod index 7991db8..4bbc94b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cri-o/ocicni -go 1.20 +go 1.22 require ( github.com/containernetworking/cni v1.2.2 diff --git a/pkg/ocicni/ocicni.go b/pkg/ocicni/ocicni.go index 13595b8..1201dc7 100644 --- a/pkg/ocicni/ocicni.go +++ b/pkg/ocicni/ocicni.go @@ -485,7 +485,7 @@ func (plugin *cniNetworkPlugin) fillPodNetworks(podNetwork *PodNetwork) error { netLoop: for i, network := range podNetwork.Networks { if network.Ifname == "" { - for j := 0; j < 10000; j++ { + for j := range 10000 { candidate := fmt.Sprintf("eth%d", j) if !allIfNames[candidate] { allIfNames[candidate] = true