mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 16:48:30 +01:00
Update to use placeholder
This commit is contained in:
parent
aa9fa581ec
commit
cea9cca52a
@ -43,7 +43,7 @@ func (n *NotificationHandler) Post() {
|
||||
err := json.Unmarshal(n.Ctx.Input.CopyBody(1<<32), ¬ification)
|
||||
|
||||
if err != nil {
|
||||
log.Error("error while decoding json: ", err)
|
||||
log.Errorf("error while decoding json: %v", err)
|
||||
return
|
||||
}
|
||||
var username, action, repo, project string
|
||||
@ -51,7 +51,7 @@ func (n *NotificationHandler) Post() {
|
||||
for _, e := range notification.Events {
|
||||
matched, err = regexp.MatchString(manifestPattern, e.Target.MediaType)
|
||||
if err != nil {
|
||||
log.Error("Failed to match the media type against pattern, error: ", err)
|
||||
log.Errorf("Failed to match the media type against pattern, error: %v", err)
|
||||
matched = false
|
||||
}
|
||||
if matched && strings.HasPrefix(e.Request.UserAgent, "docker") {
|
||||
@ -69,7 +69,7 @@ func (n *NotificationHandler) Post() {
|
||||
go func() {
|
||||
err2 := svc_utils.RefreshCatalogCache()
|
||||
if err2 != nil {
|
||||
log.Error("Error happens when refreshing cache:", err2)
|
||||
log.Errorf("Error happens when refreshing cache: %v", err2)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ type TokenHandler struct {
|
||||
func (a *TokenHandler) Get() {
|
||||
|
||||
request := a.Ctx.Request
|
||||
log.Infof("request url: " + request.URL.String())
|
||||
log.Infof("request url: %v", request.URL.String())
|
||||
username, password, _ := request.BasicAuth()
|
||||
authenticated := authenticate(username, password)
|
||||
service := a.GetString("service")
|
||||
|
@ -78,7 +78,7 @@ func FilterAccess(username string, authenticated bool, a *token.ResourceActions)
|
||||
permission = "RW"
|
||||
} else {
|
||||
permission = ""
|
||||
log.Infof("project %s does not exist, set empty permission for admin", projectName)
|
||||
log.Infof("project %s does not exist, set empty permission for admin\n", projectName)
|
||||
}
|
||||
} else {
|
||||
permission, err = dao.GetPermission(username, projectName)
|
||||
|
@ -34,7 +34,7 @@ func init() {
|
||||
var err error
|
||||
Cache, err = cache.NewCache("memory", `{"interval":720}`)
|
||||
if err != nil {
|
||||
log.Error("Failed to initialize cache, error:", err)
|
||||
log.Errorf("Failed to initialize cache, error:%v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ func RegistryAPIGet(url, username string) ([]byte, error) {
|
||||
} else if response.StatusCode == http.StatusUnauthorized {
|
||||
authenticate := response.Header.Get("WWW-Authenticate")
|
||||
str := strings.Split(authenticate, " ")[1]
|
||||
log.Debugf("url: " + url)
|
||||
log.Debugf("url: %s", url)
|
||||
var service string
|
||||
var scope string
|
||||
strs := strings.Split(str, ",")
|
||||
|
Loading…
Reference in New Issue
Block a user