From 0d3b5e03bc0606a3058ab19e2c31f021103a376b Mon Sep 17 00:00:00 2001 From: Mike Nguyen Date: Thu, 19 Mar 2026 22:11:38 +0000 Subject: [PATCH 1/2] chore: bump to go1.26 and grpc - CVE-2026-33186 (also golangci-lint to v2.10.1) Signed-off-by: Mike Nguyen --- .github/workflows/dapr_cli.yaml | 4 +- .golangci.yml | 408 +++++++++++++------------------- go.mod | 22 +- go.sum | 44 ++-- 4 files changed, 195 insertions(+), 283 deletions(-) diff --git a/.github/workflows/dapr_cli.yaml b/.github/workflows/dapr_cli.yaml index b8bb39572..892f9e318 100644 --- a/.github/workflows/dapr_cli.yaml +++ b/.github/workflows/dapr_cli.yaml @@ -29,7 +29,7 @@ jobs: name: Build ${{ matrix.target_os }}_${{ matrix.target_arch }} binaries runs-on: ${{ matrix.os }} env: - GOLANG_CI_LINT_VER: v1.64.2 + GOLANG_CI_LINT_VER: v2.10.1 GOOS: ${{ matrix.target_os }} GOARCH: ${{ matrix.target_arch }} GOPROXY: https://proxy.golang.org @@ -81,7 +81,7 @@ jobs: go-version-file: 'go.mod' - name: Run golangci-lint if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux' - uses: golangci/golangci-lint-action@v3.2.0 + uses: golangci/golangci-lint-action@v9 with: version: ${{ env.GOLANG_CI_LINT_VER }} skip-cache: true diff --git a/.golangci.yml b/.golangci.yml index 5315e1230..b9ae5831f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,271 +1,183 @@ -# options for analysis running +version: "2" run: - # default concurrency is a available CPU number concurrency: 4 - - # timeout for analysis, e.g. 30s, 5m, default is 1m - timeout: 10m - - # exit code when at least one issue was found, default is 1 issues-exit-code: 1 - - # include test files or not, default is true tests: true - - # list of build tags, all linters use it. Default is empty list. - #build-tags: - # - mytag - -issues: - # which dirs to skip: they won't be analyzed; - # can use regexp here: generated.*, regexp is applied on full path; - # default value is empty list, but next dirs are always skipped independently - # from this option's value: - # third_party$, testdata$, examples$, Godeps$, builtin$ - exclude-dirs: - - ^pkg.*client.*clientset.*versioned.* - - ^pkg.*client.*informers.*externalversions.* - - pkg.*mod.*k8s.io.* - -# output configuration options output: - # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" - formats: - - format: tab - - # print lines of code with issue, default is true - print-issued-lines: true - - # print linter name in the end of issue text, default is true - print-linter-name: true - - -# all available settings of specific linters -linters-settings: - errcheck: - # report about not checking of errors in type assetions: `a := b.(MyStruct)`; - # default is false: such cases aren't reported by default. - check-type-assertions: false - - # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; - # default is false: such cases aren't reported by default. - check-blank: false - - # [deprecated] comma-separated list of pairs of the form pkg:regex - # the regex is used to ignore names within pkg. (default "fmt:.*"). - # see https://github.com/kisielk/errcheck#the-deprecated-method for details - # ignore: fmt:.*,io/ioutil:^Read.* - - # path to a file containing a list of functions to exclude from checking - # see https://github.com/kisielk/errcheck#excluding-functions for details - exclude-functions: [] - - funlen: - lines: 60 - statements: 40 - - govet: - # settings per analyzer - settings: - printf: # analyzer name, run `go tool vet help` to see all analyzers - funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf - - github.com/dapr/cli/pkg/print.FailureStatusEvent - - github.com/dapr/cli/pkg/print.SuccessStatusEvent - - github.com/dapr/cli/pkg/print.WarningStatusEvent - - github.com/dapr/cli/pkg/print.InfoStatusEvent - - github.com/dapr/cli/pkg/print.StatusEvent - - github.com/dapr/cli/pkg/print.Spinner - - # enable or disable analyzers by name - enable: - - atomicalign - - shadow - enable-all: false - disable-all: false - revive: - # linting errors below this confidence will be ignored, default is 0.8 - confidence: 0.8 - gofmt: - # simplify code: gofmt with `-s` option, true by default - simplify: true - goimports: - # put imports beginning with prefix after 3rd-party packages; - # it's a comma-separated list of prefixes - local-prefixes: github.com/dapr/ - gocyclo: - # minimal code complexity to report, 30 by default (but we recommend 10-20) - min-complexity: 10 - gocognit: - # minimal code complexity to report, 30 by default (but we recommend 10-20) - min-complexity: 10 - dupl: - # tokens count to trigger issue, 150 by default - threshold: 100 - goconst: - # minimal length of string constant, 3 by default - min-len: 3 - # minimal occurrences count to trigger, 3 by default - min-occurrences: 5 - depguard: - rules: - main: - deny: - - pkg: "github.com/Sirupsen/logrus" - desc: "must use github.com/sirupsen/logrus" - misspell: - # Correct spellings using locale preferences for US or UK. - # Default is to use a neutral variety of English. - # Setting locale to US will correct the British spelling of 'colour' to 'color'. - # locale: US - ignore-words: - - someword - lll: - # max line length, lines longer will be reported. Default is 120. - # '\t' is counted as 1 character by default, and can be changed with the tab-width option - line-length: 120 - # tab width in spaces. Default to 1. - tab-width: 1 - unused: - # treat code as a program (not a library) and report unused exported identifiers; default is false. - # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: - # if it's called for subdir of a project it can't find funcs usages. All text editor integrations - # with golangci-lint call it on a directory with the changed file. - exported-fields-are-used: false - unparam: - # Inspect exported functions, default is false. Set to true if no external program/library imports your code. - # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: - # if it's called for subdir of a project it can't find external interfaces. All text editor integrations - # with golangci-lint call it on a directory with the changed file. - check-exported: false - nakedret: - # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 - max-func-lines: 30 - prealloc: - # XXX: we don't recommend using this linter before doing performance profiling. - # For most programs usage of prealloc will be a premature optimization. - - # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. - # True by default. - simple: true - range-loops: true # Report preallocation suggestions on range loops, true by default - for-loops: false # Report preallocation suggestions on for loops, false by default - gocritic: - # Which checks should be enabled; can't be combined with 'disabled-checks'; - # See https://go-critic.github.io/overview#checks-overview - # To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run` - # By default list of stable checks is used. - enabled-checks: [] - - # Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty - disabled-checks: - - regexpMust - - rangeValCopy - - hugeParam - - ifElseChain - - singleCaseSwitch - - exitAfterDefer - - # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. - # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". - enabled-tags: - - performance - - settings: # settings passed to gocritic - captLocal: # must be valid enabled check name - paramsOnly: true - godox: - # report any comments starting with keywords, this is useful for TODO or FIXME comments that - # might be left in the code accidentally and should be resolved before merging - keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting - - NOTE - - OPTIMIZE # marks code that should be optimized before merging - - HACK # marks hack-arounds that should be removed before merging - godot: - exclude: - - 'nosec' - capital: false - scope: all - dogsled: - # checks assignments with too many blank identifiers; default is 2 - max-blank-identifiers: 2 - - whitespace: - multi-if: false # Enforces newlines (or comments) after every multi-line if statement - multi-func: false # Enforces newlines (or comments) after every multi-line function signature - - wsl: - # If true append is only allowed to be cuddled if appending value is - # matching variables, fields or types on line above. Default is true. - strict-append: true - # Allow calls and assignments to be cuddled as long as the lines have any - # matching variables, fields or types. Default is true. - allow-assign-and-call: true - # Allow multiline assignments to be cuddled. Default is true. - allow-multiline-assign: true - # Allow case blocks to end with a whitespace. - # Allow declarations (var) to be cuddled. - allow-cuddle-declarations: false - testifylint: - disable: - - require-error - - + formats: + tab: + path: stdout + print-linter-name: true + colors: false linters: - default: all disable: - # TODO Enforce the below linters later - - musttag + - asasalint + - canonicalheader + - containedctx + - contextcheck + - cyclop - dupl + - err113 - errcheck + - errchkjson + - errorlint + - exhaustive + - exhaustruct + - fatcontext + - forbidigo + - forcetypeassert - funlen - gochecknoglobals - gochecknoinits - - gocyclo - gocognit + - gocyclo + - godot - godox + - gomoddirectives + - inamedparam + - ireturn - lll - - unparam - - wsl - - testpackage + - maintidx + - mnd + - musttag - nestif + - nilnil - nlreturn - - exhaustive - - exhaustruct - noctx - - gci - - tparallel + - nonamedreturns - paralleltest - - wrapcheck - - tagliatelle - - ireturn - - errchkjson - - contextcheck - - gomoddirectives - - godot - - cyclop - - varnamelen - - errorlint - - forcetypeassert - - maintidx - - nilnil - predeclared - - tenv - - thelper - - wastedassign - - containedctx - - gosimple - - nonamedreturns - - asasalint - rowserrcheck - sqlclosecheck - - inamedparam - tagalign - - mnd - - canonicalheader - - err113 - - fatcontext - - forbidigo + - tagliatelle + - testpackage + - thelper + - tparallel + - unparam + - varnamelen + - wastedassign + - wrapcheck + - wsl + settings: + depguard: + rules: + main: + deny: + - pkg: github.com/Sirupsen/logrus + desc: must use github.com/sirupsen/logrus + dogsled: + max-blank-identifiers: 2 + dupl: + threshold: 100 + errcheck: + check-type-assertions: false + check-blank: false + funlen: + lines: 60 + statements: 40 + gocognit: + min-complexity: 10 + goconst: + min-len: 3 + min-occurrences: 5 + gocritic: + disabled-checks: + - regexpMust + - rangeValCopy + - hugeParam + - ifElseChain + - singleCaseSwitch + - exitAfterDefer + enabled-tags: + - performance + settings: + captLocal: + paramsOnly: true + gocyclo: + min-complexity: 10 + godot: + scope: all + exclude: + - nosec + capital: false + godox: + keywords: + - NOTE + - OPTIMIZE + - HACK + govet: + enable: + - atomicalign + - shadow + enable-all: false + disable-all: false + settings: + printf: + funcs: + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + - github.com/dapr/cli/pkg/print.FailureStatusEvent + - github.com/dapr/cli/pkg/print.SuccessStatusEvent + - github.com/dapr/cli/pkg/print.WarningStatusEvent + - github.com/dapr/cli/pkg/print.InfoStatusEvent + - github.com/dapr/cli/pkg/print.StatusEvent + - github.com/dapr/cli/pkg/print.Spinner + lll: + line-length: 120 + tab-width: 1 + misspell: + ignore-rules: + - someword + nakedret: + max-func-lines: 30 + prealloc: + simple: true + range-loops: true + for-loops: false + revive: + confidence: 0.8 + testifylint: + disable: + - require-error + unparam: + check-exported: false + unused: + exported-fields-are-used: false + whitespace: + multi-if: false + multi-func: false + wsl: + strict-append: true + allow-assign-and-call: true + allow-multiline-assign: true + allow-cuddle-declarations: false + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - ^pkg.*client.*clientset.*versioned.* + - ^pkg.*client.*informers.*externalversions.* + - pkg.*mod.*k8s.io.* + - third_party$ + - builtin$ + - examples$ +formatters: + settings: + gofmt: + simplify: true + goimports: + local-prefixes: + - github.com/dapr/ + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/go.mod b/go.mod index ef57f7f25..e74e80be7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/dapr/cli -go 1.24.13 +go 1.26.0 require ( github.com/Masterminds/semver v1.5.0 @@ -37,9 +37,9 @@ require ( github.com/stretchr/testify v1.11.1 go.etcd.io/etcd/client/v3 v3.5.21 go.mongodb.org/mongo-driver v1.14.0 - golang.org/x/mod v0.31.0 - golang.org/x/sys v0.40.0 - google.golang.org/grpc v1.78.0 + golang.org/x/mod v0.33.0 + golang.org/x/sys v0.42.0 + google.golang.org/grpc v1.79.3 google.golang.org/protobuf v1.36.11 gopkg.in/yaml.v2 v2.4.0 helm.sh/helm/v3 v3.18.5 @@ -53,7 +53,7 @@ require ( ) require ( - cel.dev/expr v0.24.0 // indirect + cel.dev/expr v0.25.1 // indirect contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect dario.cat/mergo v1.0.2 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -241,16 +241,16 @@ require ( go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.47.0 // indirect + golang.org/x/crypto v0.49.0 // indirect golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect - golang.org/x/net v0.49.0 // indirect + golang.org/x/net v0.52.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect - golang.org/x/sync v0.19.0 // indirect - golang.org/x/term v0.39.0 // indirect - golang.org/x/text v0.33.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/term v0.41.0 // indirect + golang.org/x/text v0.35.0 // indirect golang.org/x/time v0.12.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 1b812a720..b0fd4bb41 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= -cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= +cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4= +cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -783,8 +783,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= -golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= +golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -818,8 +818,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI= -golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg= +golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= +golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -855,8 +855,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= -golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -878,8 +878,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= -golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -930,12 +930,12 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= -golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY= -golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww= +golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= +golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -944,8 +944,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= -golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= +golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= +golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -996,8 +996,8 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA= -golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc= +golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= +golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1060,8 +1060,8 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 h1:merA0rdPeUV3YIIfHHcH4qBkiQAc1nfCKSI7lB4cV2M= google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409/go.mod h1:fl8J1IvUjCilwZzQowmw2b7HQB2eAuYBabMXzWurF+I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 h1:H86B94AW+VfJWDqFeEbBPhEtHzJwJfTbgE2lZa54ZAQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 h1:ndE4FoJqsIceKP2oYSnUZqhTdYufCYYkqwtFzfrhI7w= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1075,8 +1075,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc= -google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U= +google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= +google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= google.golang.org/grpc/examples v0.0.0-20250407062114-b368379ef8f6 h1:ExN12ndbJ608cboPYflpTny6mXSzPrDLh0iTaVrRrds= google.golang.org/grpc/examples v0.0.0-20250407062114-b368379ef8f6/go.mod h1:6ytKWczdvnpnO+m+JiG9NjEDzR1FJfsnmJdG7B8QVZ8= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= From 47741c63bcd3ee12e281840bea6cddb43b9142c7 Mon Sep 17 00:00:00 2001 From: Mike Nguyen Date: Thu, 19 Mar 2026 22:13:10 +0000 Subject: [PATCH 2/2] chore: linter fixes Signed-off-by: Mike Nguyen --- cmd/run.go | 16 ++++++++-------- cmd/workflow/workflow.go | 2 +- pkg/kubernetes/kubernetes.go | 7 ++++--- pkg/kubernetes/pods.go | 5 +++-- pkg/kubernetes/run.go | 20 ++++++++++---------- pkg/kubernetes/upgrade.go | 6 ++---- pkg/standalone/standalone.go | 2 +- pkg/workflow/dclient/dclient.go | 4 ++-- tests/e2e/common/common.go | 16 ++++++++-------- tests/e2e/upgrade/upgrade_test.go | 10 +++++----- 10 files changed, 44 insertions(+), 44 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index f7a1e3182..3f519d01e 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -525,24 +525,24 @@ func executeRun(runTemplateName, runFilePath string, apps []runfileconfig.App) ( daprsyscall.CreateProcessGroupID() for _, app := range apps { - print.StatusEvent(os.Stdout, print.LogInfo, "Validating config and starting app %q", app.RunConfig.AppID) + print.StatusEvent(os.Stdout, print.LogInfo, "Validating config and starting app %q", app.AppID) // Set defaults if zero value provided in config yaml. - app.RunConfig.SetDefaultFromSchema() + app.SetDefaultFromSchema() // Adjust scheduler host address defaults for run-file apps (pointer-aware) var schedIn string - if app.RunConfig.SchedulerHostAddress != nil { - schedIn = *app.RunConfig.SchedulerHostAddress + if app.SchedulerHostAddress != nil { + schedIn = *app.SchedulerHostAddress } schedOut := validateSchedulerHostAddress(daprVer.RuntimeVersion, schedIn) if schedOut != "" { - app.RunConfig.SchedulerHostAddress = &schedOut + app.SchedulerHostAddress = &schedOut } // Validate validates the configs and modifies the ports to free ports, appId etc. - err := app.RunConfig.Validate() + err := app.Validate() if err != nil { - print.FailureStatusEvent(os.Stderr, "Error validating run config for app %q present in %s: %s", app.RunConfig.AppID, runFilePath, err.Error()) + print.FailureStatusEvent(os.Stderr, "Error validating run config for app %q present in %s: %s", app.AppID, runFilePath, err.Error()) exitWithError = true break } @@ -648,7 +648,7 @@ func executeRun(runTemplateName, runFilePath string, apps []runfileconfig.App) ( func logInformationalStatusToStdout(app runfileconfig.App) { print.InfoStatusEvent(os.Stdout, "Started Dapr with app id %q. HTTP Port: %d. gRPC Port: %d", - app.AppID, app.RunConfig.HTTPPort, app.RunConfig.GRPCPort) + app.AppID, app.HTTPPort, app.GRPCPort) print.InfoStatusEvent(os.Stdout, "Writing log files to directory : %s", app.GetLogsDir()) } diff --git a/cmd/workflow/workflow.go b/cmd/workflow/workflow.go index bbfb91ff5..7f4cef182 100644 --- a/cmd/workflow/workflow.go +++ b/cmd/workflow/workflow.go @@ -70,7 +70,7 @@ func outputFunc(cmd *cobra.Command) *string { pre := cmd.PreRunE cmd.PreRunE = func(cmd *cobra.Command, args []string) error { if !slices.Contains(outputs, outputFormat) { - return errors.New("invalid value for --output. Supported values are 'short', 'wide', 'yaml', 'json'.") + return errors.New("invalid value for --output. Supported values are 'short', 'wide', 'yaml', 'json'") } if pre != nil { diff --git a/pkg/kubernetes/kubernetes.go b/pkg/kubernetes/kubernetes.go index 8fd8c5e7d..fd0ef4c62 100644 --- a/pkg/kubernetes/kubernetes.go +++ b/pkg/kubernetes/kubernetes.go @@ -178,11 +178,12 @@ func getVersion(releaseName string, version string) (string, error) { actualVersion := version if version == latestVersion { var err error - if releaseName == daprReleaseName { + switch releaseName { + case daprReleaseName: actualVersion, err = cli_ver.GetDaprVersion() - } else if releaseName == dashboardReleaseName { + case dashboardReleaseName: actualVersion, err = cli_ver.GetDashboardVersion() - } else { + default: return "", fmt.Errorf("cannot get latest version for unknown chart: %s", releaseName) } if err != nil { diff --git a/pkg/kubernetes/pods.go b/pkg/kubernetes/pods.go index ee88fdabf..16b34a184 100644 --- a/pkg/kubernetes/pods.go +++ b/pkg/kubernetes/pods.go @@ -115,9 +115,10 @@ func waitPodRunning(ctx context.Context, client k8s.Interface, namespace, appID case event := <-watcher.ResultChan(): pod := event.Object.(*corev1.Pod) - if pod.Status.Phase == corev1.PodRunning { + switch pod.Status.Phase { + case corev1.PodRunning: return nil - } else if pod.Status.Phase == corev1.PodFailed || pod.Status.Phase == corev1.PodUnknown { + case corev1.PodFailed, corev1.PodUnknown: return fmt.Errorf("error waiting for pod run: %w", errPodUnknown) } diff --git a/pkg/kubernetes/run.go b/pkg/kubernetes/run.go index 5297e4b76..9985e3406 100644 --- a/pkg/kubernetes/run.go +++ b/pkg/kubernetes/run.go @@ -120,28 +120,28 @@ func Run(runFilePath string, config runfileconfig.RunFileConfig) (bool, error) { print.InfoStatusEvent(os.Stdout, "This is a preview feature and subject to change in future releases.") for _, app := range config.Apps { - print.StatusEvent(os.Stdout, print.LogInfo, "Validating config and starting app %q", app.RunConfig.AppID) + print.StatusEvent(os.Stdout, print.LogInfo, "Validating config and starting app %q", app.AppID) // Set defaults if zero value provided in config yaml. - app.RunConfig.SetDefaultFromSchema() + app.SetDefaultFromSchema() // Validate validates the configs for k8s and modifies appId etc. - err := app.RunConfig.ValidateK8s() + err := app.ValidateK8s() if err != nil { - print.FailureStatusEvent(os.Stderr, "Error validating run config for app %q present in %s: %s", app.RunConfig.AppID, runFilePath, err.Error()) + print.FailureStatusEvent(os.Stderr, "Error validating run config for app %q present in %s: %s", app.AppID, runFilePath, err.Error()) exitWithError = true break } var svc serviceConfig // create default service config. - if app.ContainerConfiguration.CreateService { + if app.CreateService { svc = createServiceConfig(app) } // create default deployment config. dep := createDeploymentConfig(daprClient, app) if err != nil { - print.FailureStatusEvent(os.Stderr, "Error creating deployment file for app %q present in %s: %s", app.RunConfig.AppID, runFilePath, err.Error()) + print.FailureStatusEvent(os.Stderr, "Error creating deployment file for app %q present in %s: %s", app.AppID, runFilePath, err.Error()) exitWithError = true break } @@ -245,7 +245,7 @@ func createServiceConfig(app runfileconfig.App) serviceConfig { Kind: serviceKind, APIVersion: serviceAPIVersion, Metadata: map[string]any{ - nameKey: app.RunConfig.AppID, + nameKey: app.AppID, labelsKey: map[string]string{ appLabelKey: app.AppID, }, @@ -289,7 +289,7 @@ func createDeploymentConfig(client versioned.Interface, app runfileconfig.App) d Labels: map[string]string{ appLabelKey: app.AppID, }, - Annotations: app.RunConfig.GetAnnotations(), + Annotations: app.GetAnnotations(), }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -304,11 +304,11 @@ func createDeploymentConfig(client versioned.Interface, app runfileconfig.App) d }, } // Set dapr.io/enable annotation. - dep.Spec.Template.ObjectMeta.Annotations[daprEnableAnnotationKey] = "true" + dep.Spec.Template.Annotations[daprEnableAnnotationKey] = "true" if ok, _ := isConfigurationPresent(client, corev1.NamespaceDefault, daprConfigAnnotationValue); ok { // Set dapr.io/config annotation only if present. - dep.Spec.Template.ObjectMeta.Annotations[daprConfigAnnotationKey] = daprConfigAnnotationValue + dep.Spec.Template.Annotations[daprConfigAnnotationKey] = daprConfigAnnotationValue } else { print.WarningStatusEvent(os.Stderr, "Dapr configuration %q not found in namespace %q. Skipping annotation %q", daprConfigAnnotationValue, corev1.NamespaceDefault, daprConfigAnnotationKey) } diff --git a/pkg/kubernetes/upgrade.go b/pkg/kubernetes/upgrade.go index 1b0b96002..1eb33d7aa 100644 --- a/pkg/kubernetes/upgrade.go +++ b/pkg/kubernetes/upgrade.go @@ -256,10 +256,8 @@ func deleteSchedulerPods(namespace string, currentVersion *semver.Version, targe // wait for at least one pod of the target version to be in the list before deleting the rest // check the label app.kubernetes.io/version to determine the version of the pod foundTargetVersion := false - for { - if foundTargetVersion { - break - } + for !foundTargetVersion { + k8sClient, err := Client() if err != nil { return err diff --git a/pkg/standalone/standalone.go b/pkg/standalone/standalone.go index 7adc86aeb..391d4b392 100644 --- a/pkg/standalone/standalone.go +++ b/pkg/standalone/standalone.go @@ -916,7 +916,7 @@ func createComponentsAndConfiguration(wg *sync.WaitGroup, errorChan chan<- error func createSlimConfiguration(wg *sync.WaitGroup, errorChan chan<- error, info initInfo) { defer wg.Done() - if !(info.slimMode || isAirGapInit) { + if !info.slimMode && !isAirGapInit { return } diff --git a/pkg/workflow/dclient/dclient.go b/pkg/workflow/dclient/dclient.go index 318a9ca14..6bc658405 100644 --- a/pkg/workflow/dclient/dclient.go +++ b/pkg/workflow/dclient/dclient.go @@ -92,7 +92,7 @@ func stand(ctx context.Context, opts Options) (*Client, error) { } if proc == nil { - return nil, fmt.Errorf("Dapr app with id '%s' not found", opts.AppID) + return nil, fmt.Errorf("dapr app with id '%s' not found", opts.AppID) } resourcePaths := proc.ResourcePaths @@ -147,7 +147,7 @@ func kube(ctx context.Context, opts Options) (*Client, error) { } if pod == nil { - return nil, fmt.Errorf("Dapr app with id '%s' not found in namespace %s", opts.AppID, opts.Namespace) + return nil, fmt.Errorf("dapr app with id '%s' not found in namespace %s", opts.AppID, opts.Namespace) } config, _, err := kubernetes.GetKubeConfigClient() diff --git a/tests/e2e/common/common.go b/tests/e2e/common/common.go index d5bff7dd4..2f905f2a1 100644 --- a/tests/e2e/common/common.go +++ b/tests/e2e/common/common.go @@ -1087,7 +1087,7 @@ func validateThirdpartyPodsOnInit(t *testing.T) { devZipkinReleaseName: "dapr-dev-zipkin-", } for _, pod := range list.Items { - t.Log(pod.ObjectMeta.Name) + t.Log(pod.Name) for component, prefix := range prefixes { if pod.Status.Phase != core_v1.PodRunning { continue @@ -1095,7 +1095,7 @@ func validateThirdpartyPodsOnInit(t *testing.T) { if !pod.Status.ContainerStatuses[0].Ready { continue } - if strings.HasPrefix(pod.ObjectMeta.Name, prefix) { + if strings.HasPrefix(pod.Name, prefix) { delete(notFound, component) } } @@ -1139,7 +1139,7 @@ func validatePodsOnInstallUpgrade(t *testing.T, details VersionDetails) { t.Logf("items %d", len(list.Items)) for _, pod := range list.Items { - t.Log(pod.ObjectMeta.Name) + t.Log(pod.Name) for component, prefix := range prefixes { if pod.Status.Phase != core_v1.PodRunning { continue @@ -1147,7 +1147,7 @@ func validatePodsOnInstallUpgrade(t *testing.T, details VersionDetails) { if !pod.Status.ContainerStatuses[0].Ready { continue } - if strings.HasPrefix(pod.ObjectMeta.Name, prefix) { + if strings.HasPrefix(pod.Name, prefix) { expectedVersion, ok := notFound[component] if !ok { continue @@ -1198,7 +1198,7 @@ func waitPodDeletionDev(t *testing.T, done, podsDeleted chan struct{}) { t.Logf("dev pods waiting to be deleted: %d", len(list.Items)) for _, pod := range list.Items { - t.Log(pod.ObjectMeta.Name) + t.Log(pod.Name) for component, prefix := range prefixes { if pod.Status.Phase != core_v1.PodRunning { continue @@ -1206,7 +1206,7 @@ func waitPodDeletionDev(t *testing.T, done, podsDeleted chan struct{}) { if !pod.Status.ContainerStatuses[0].Ready { continue } - if strings.HasPrefix(pod.ObjectMeta.Name, prefix) { + if strings.HasPrefix(pod.Name, prefix) { delete(found, component) } } @@ -1244,7 +1244,7 @@ func waitPodDeletion(t *testing.T, done, podsDeleted chan struct{}) { } else { t.Logf("pods waiting to be deleted: %d", len(list.Items)) for _, pod := range list.Items { - t.Log(pod.ObjectMeta.Name) + t.Log(pod.Name) } } time.Sleep(5 * time.Second) @@ -1271,7 +1271,7 @@ func waitAllPodsRunning(t *testing.T, namespace string, haEnabled bool, done, po t.Logf("waiting for pods to be running, current count: %d", len(list.Items)) countOfReadyPods := 0 for _, item := range list.Items { - t.Log(item.ObjectMeta.Name) + t.Log(item.Name) // Check pods running, and containers ready. if item.Status.Phase == core_v1.PodRunning && len(item.Status.ContainerStatuses) != 0 { size := len(item.Status.ContainerStatuses) diff --git a/tests/e2e/upgrade/upgrade_test.go b/tests/e2e/upgrade/upgrade_test.go index 3a2db0801..81e3f67f3 100644 --- a/tests/e2e/upgrade/upgrade_test.go +++ b/tests/e2e/upgrade/upgrade_test.go @@ -178,7 +178,7 @@ func getTestsOnUpgrade(p upgradePath, installOpts, upgradeOpts common.TestOption func TestUpgradePathNonHAModeMTLSDisabled(t *testing.T) { if common.ShouldSkipTest(common.DaprModeNonHA) { - t.Skip(fmt.Sprintf("Skipping %s mode test", common.DaprModeNonHA)) + t.Skipf("Skipping %s mode test", common.DaprModeNonHA) } // Ensure a clean environment. @@ -227,7 +227,7 @@ func TestUpgradePathNonHAModeMTLSDisabled(t *testing.T) { func TestUpgradePathNonHAModeMTLSEnabled(t *testing.T) { if common.ShouldSkipTest(common.DaprModeNonHA) { - t.Skip(fmt.Sprintf("Skipping %s mode test", common.DaprModeNonHA)) + t.Skipf("Skipping %s mode test", common.DaprModeNonHA) } // Ensure a clean environment. @@ -276,7 +276,7 @@ func TestUpgradePathNonHAModeMTLSEnabled(t *testing.T) { func TestUpgradePathHAModeMTLSDisabled(t *testing.T) { if common.ShouldSkipTest(common.DaprModeHA) { - t.Skip(fmt.Sprintf("Skipping %s mode test", common.DaprModeHA)) + t.Skipf("Skipping %s mode test", common.DaprModeHA) } // Ensure a clean environment. @@ -324,7 +324,7 @@ func TestUpgradePathHAModeMTLSDisabled(t *testing.T) { func TestUpgradePathHAModeMTLSEnabled(t *testing.T) { if common.ShouldSkipTest(common.DaprModeHA) { - t.Skip(fmt.Sprintf("Skipping %s mode test", common.DaprModeHA)) + t.Skipf("Skipping %s mode test", common.DaprModeHA) } // Ensure a clean environment. @@ -375,7 +375,7 @@ func TestUpgradePathHAModeMTLSEnabled(t *testing.T) { // This test verifies install/upgrade functionality with this additional resource. func TestUpgradeWithHTTPEndpoint(t *testing.T) { if common.ShouldSkipTest(common.DaprModeHA) { - t.Skip(fmt.Sprintf("Skipping %s mode test", common.DaprModeHA)) + t.Skipf("Skipping %s mode test", common.DaprModeHA) } // Ensure a clean environment.