diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2ff76a6d..e0c259ca 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -43,7 +43,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v7 with: - version: v2.13.2 + version: v2.14.0 args: --timeout=10m dco: diff --git a/pkg/commands/preflight_upgrade_verify.go b/pkg/commands/preflight_upgrade_verify.go index a9e76c92..4e2b4adb 100644 --- a/pkg/commands/preflight_upgrade_verify.go +++ b/pkg/commands/preflight_upgrade_verify.go @@ -149,11 +149,9 @@ func parseTargetVersion(image string) string { // suffix after `:`. Splitting on `/` first isolates that // component, so a registry port (`registry.local:5000`) in an // earlier path component cannot be mistaken for a tag separator. - lastSlash := strings.LastIndex(image, "/") - tail := image - if lastSlash >= 0 { - tail = image[lastSlash+1:] + if _, after, found := strings.CutLast(image, "/"); found { + tail = after } idx := strings.LastIndex(tail, ":")