all: change vulncheck endpoints to govulncheck
Note that this CL still does not change the name of the table. This will
come in a separate CL together with table schema change.
This changes comes as a part of CL series that replace the uses of
"vulncheck" with "govulncheck".
Change-Id: I044b807752e67beb10bf1b10569c3c500188ebb8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite-metrics/+/476495
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/Makefile b/Makefile
index 085b3eb..73652b8 100644
--- a/Makefile
+++ b/Makefile
@@ -93,7 +93,7 @@
# Test by scanning a small module.
govulncheck-test:
- curl -s 'http://localhost:8080/vulncheck/scan/github.com/fossas/fossa-cli@v1.1.10?importedby=1&serve=true' > $(GOVULNCHECK_TEST_FILE)
+ curl -s 'http://localhost:8080/govulncheck/scan/github.com/fossas/fossa-cli@v1.1.10?importedby=1&serve=true' > $(GOVULNCHECK_TEST_FILE)
@if [[ `grep -c GO-2020-0016 $(GOVULNCHECK_TEST_FILE)` -ge 4 ]]; then \
echo PASS; \
rm $(GOVULNCHECK_TEST_FILE); \
diff --git a/internal/worker/govulncheck_scan.go b/internal/worker/govulncheck_scan.go
index b9b00d8..ce66a99 100644
--- a/internal/worker/govulncheck_scan.go
+++ b/internal/worker/govulncheck_scan.go
@@ -75,7 +75,7 @@
}()
ctx := r.Context()
- sreq, err := govulncheck.ParseRequest(r, "/vulncheck/scan")
+ sreq, err := govulncheck.ParseRequest(r, "/govulncheck/scan")
if err != nil {
return fmt.Errorf("%w: %v", derrors.InvalidArgument, err)
}
diff --git a/internal/worker/server.go b/internal/worker/server.go
index 356c885..57b0adc 100644
--- a/internal/worker/server.go
+++ b/internal/worker/server.go
@@ -171,10 +171,10 @@
return err
}
- s.handle("/vulncheck/enqueueall", h.handleEnqueueAll)
- s.handle("/vulncheck/enqueue", h.handleEnqueue)
- s.handle("/vulncheck/scan/", h.handleScan)
- s.handle("/vulncheck/insert-results", h.handleInsertResults)
+ s.handle("/govulncheck/enqueueall", h.handleEnqueueAll)
+ s.handle("/govulncheck/enqueue", h.handleEnqueue)
+ s.handle("/govulncheck/scan/", h.handleScan)
+ s.handle("/govulncheck/insert-results", h.handleInsertResults)
return nil
}
diff --git a/terraform/environment/worker.tf b/terraform/environment/worker.tf
index c7d2ae9..42b88e9 100644
--- a/terraform/environment/worker.tf
+++ b/terraform/environment/worker.tf
@@ -258,7 +258,7 @@
http_target {
http_method = "GET"
- uri = "${local.worker_url}/vulncheck/enqueueall?min=15"
+ uri = "${local.worker_url}/govulncheck/enqueueall?min=15"
oidc_token {
service_account_email = local.worker_service_account
audience = local.worker_url
@@ -276,7 +276,7 @@
http_target {
http_method = "GET"
- uri = "${local.worker_url}/vulncheck/insert-results"
+ uri = "${local.worker_url}/govulncheck/insert-results"
oidc_token {
service_account_email = local.worker_service_account
audience = local.worker_url