mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-01 12:31:23 +01:00
Remove the health checker for Clair in health check API
As we introduce the pluggable scanner, users can add the external scanners, so we remove the Clair from the health check API Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
parent
cf87408e90
commit
9d896d4d72
@ -137,7 +137,6 @@ const (
|
|||||||
DefaultChartRepoURL = "http://chartmuseum:9999"
|
DefaultChartRepoURL = "http://chartmuseum:9999"
|
||||||
DefaultPortalURL = "http://portal:8080"
|
DefaultPortalURL = "http://portal:8080"
|
||||||
DefaultRegistryCtlURL = "http://registryctl:8080"
|
DefaultRegistryCtlURL = "http://registryctl:8080"
|
||||||
DefaultClairHealthCheckServerURL = "http://clair:6061"
|
|
||||||
// Use this prefix to distinguish harbor user, the prefix contains a special character($), so it cannot be registered as a harbor user.
|
// Use this prefix to distinguish harbor user, the prefix contains a special character($), so it cannot be registered as a harbor user.
|
||||||
RobotPrefix = "robot$"
|
RobotPrefix = "robot$"
|
||||||
// Use this prefix to index user who tries to login with web hook token.
|
// Use this prefix to index user who tries to login with web hook token.
|
||||||
|
@ -22,14 +22,12 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/goharbor/harbor/src/common/utils"
|
"github.com/docker/distribution/health"
|
||||||
|
|
||||||
"github.com/goharbor/harbor/src/common/dao"
|
"github.com/goharbor/harbor/src/common/dao"
|
||||||
httputil "github.com/goharbor/harbor/src/common/http"
|
httputil "github.com/goharbor/harbor/src/common/http"
|
||||||
|
"github.com/goharbor/harbor/src/common/utils"
|
||||||
"github.com/goharbor/harbor/src/common/utils/log"
|
"github.com/goharbor/harbor/src/common/utils/log"
|
||||||
"github.com/goharbor/harbor/src/core/config"
|
"github.com/goharbor/harbor/src/core/config"
|
||||||
|
|
||||||
"github.com/docker/distribution/health"
|
|
||||||
"github.com/gomodule/redigo/redis"
|
"github.com/gomodule/redigo/redis"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -240,14 +238,6 @@ func chartmuseumHealthChecker() health.Checker {
|
|||||||
return PeriodicHealthChecker(checker, period)
|
return PeriodicHealthChecker(checker, period)
|
||||||
}
|
}
|
||||||
|
|
||||||
func clairHealthChecker() health.Checker {
|
|
||||||
url := config.GetClairHealthCheckServerURL() + "/health"
|
|
||||||
timeout := 60 * time.Second
|
|
||||||
period := 10 * time.Second
|
|
||||||
checker := HTTPStatusCodeHealthChecker(http.MethodGet, url, nil, timeout, http.StatusOK)
|
|
||||||
return PeriodicHealthChecker(checker, period)
|
|
||||||
}
|
|
||||||
|
|
||||||
func notaryHealthChecker() health.Checker {
|
func notaryHealthChecker() health.Checker {
|
||||||
url := config.InternalNotaryEndpoint() + "/_notary_server/health"
|
url := config.InternalNotaryEndpoint() + "/_notary_server/health"
|
||||||
timeout := 60 * time.Second
|
timeout := 60 * time.Second
|
||||||
@ -301,9 +291,6 @@ func registerHealthCheckers() {
|
|||||||
if config.WithChartMuseum() {
|
if config.WithChartMuseum() {
|
||||||
HealthCheckerRegistry["chartmuseum"] = chartmuseumHealthChecker()
|
HealthCheckerRegistry["chartmuseum"] = chartmuseumHealthChecker()
|
||||||
}
|
}
|
||||||
if config.WithClair() {
|
|
||||||
HealthCheckerRegistry["clair"] = clairHealthChecker()
|
|
||||||
}
|
|
||||||
if config.WithNotary() {
|
if config.WithNotary() {
|
||||||
HealthCheckerRegistry["notary"] = notaryHealthChecker()
|
HealthCheckerRegistry["notary"] = notaryHealthChecker()
|
||||||
}
|
}
|
||||||
|
@ -461,16 +461,6 @@ func GetRegistryCtlURL() string {
|
|||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetClairHealthCheckServerURL returns the URL of
|
|
||||||
// the health check server of Clair
|
|
||||||
func GetClairHealthCheckServerURL() string {
|
|
||||||
url := os.Getenv("CLAIR_HEALTH_CHECK_SERVER_URL")
|
|
||||||
if len(url) == 0 {
|
|
||||||
return common.DefaultClairHealthCheckServerURL
|
|
||||||
}
|
|
||||||
return url
|
|
||||||
}
|
|
||||||
|
|
||||||
// HTTPAuthProxySetting returns the setting of HTTP Auth proxy. the settings are only meaningful when the auth_mode is
|
// HTTPAuthProxySetting returns the setting of HTTP Auth proxy. the settings are only meaningful when the auth_mode is
|
||||||
// set to http_auth
|
// set to http_auth
|
||||||
func HTTPAuthProxySetting() (*models.HTTPAuthProxy, error) {
|
func HTTPAuthProxySetting() (*models.HTTPAuthProxy, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user