Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Jun 3, 2024
1 parent a43fc32 commit 6c28276
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/stupgrades/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func server(params *cli) error {
}

mux := http.NewServeMux()
mux.Handle("/meta.json", httpcache.SinglePath(&githubReleases{url: params.URL}, params.CacheTime))
mux.Handle("/meta.json", withVersionCounter(httpcache.SinglePath(&githubReleases{url: params.URL}, params.CacheTime)))

for _, fwd := range params.Forward {
path, url, ok := strings.Cut(fwd, "->")
Expand Down Expand Up @@ -87,7 +87,9 @@ func withVersionCounter(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ua := r.Header.Get("User-Agent")
ver, err := build.ParseVersion(ua)

Check failure on line 89 in cmd/stupgrades/main.go

View workflow job for this annotation

GitHub Actions / Build and test (windows-latest, ~1.21.7)

undefined: build.ParseVersion

Check failure on line 89 in cmd/stupgrades/main.go

View workflow job for this annotation

GitHub Actions / Build and push Docker images (stupgrades)

undefined: build.ParseVersion

Check failure on line 89 in cmd/stupgrades/main.go

View workflow job for this annotation

GitHub Actions / Build and test (windows-latest, ~1.22.3)

undefined: build.ParseVersion

Check failure on line 89 in cmd/stupgrades/main.go

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, ~1.21.7)

undefined: build.ParseVersion

Check failure on line 89 in cmd/stupgrades/main.go

View workflow job for this annotation

GitHub Actions / Build and test (ubuntu-latest, ~1.22.3)

undefined: build.ParseVersion

Check failure on line 89 in cmd/stupgrades/main.go

View workflow job for this annotation

GitHub Actions / Build and test (macos-latest, ~1.21.7)

undefined: build.ParseVersion

Check failure on line 89 in cmd/stupgrades/main.go

View workflow job for this annotation

GitHub Actions / Build and test (macos-latest, ~1.22.3)

undefined: build.ParseVersion

Check failure on line 89 in cmd/stupgrades/main.go

View workflow job for this annotation

GitHub Actions / Run govulncheck

undefined: build.ParseVersion
if err == nil {
if err != nil {
versionCounter.WithLabelValues("unknown").Inc()
} else {
v := ver.Tag
v = strings.TrimPrefix(v, "v")
if idx := strings.Index(v, "-"); idx != -1 {
Expand Down

0 comments on commit 6c28276

Please sign in to comment.