diff --git a/src/core/api/chart_label.go b/src/core/api/chart_label.go index e70254e77..6379c9a59 100644 --- a/src/core/api/chart_label.go +++ b/src/core/api/chart_label.go @@ -14,7 +14,7 @@ const ( idParam = ":id" ) -// ChartLabelAPI handles the requests of marking/removing lables to/from charts. +// ChartLabelAPI handles the requests of marking/removing labels to/from charts. type ChartLabelAPI struct { LabelResourceAPI project *models.Project diff --git a/src/core/api/chart_repository.go b/src/core/api/chart_repository.go index 7c45d36bc..bc7ad8487 100755 --- a/src/core/api/chart_repository.go +++ b/src/core/api/chart_repository.go @@ -269,7 +269,7 @@ func (cra *ChartRepositoryAPI) DeleteChartVersion() { chartName := cra.GetStringFromPath(nameParam) version := cra.GetStringFromPath(versionParam) - // Try to remove labels from deleting chart if exitsing + // Try to remove labels from deleting chart if existing if err := cra.removeLabelsFromChart(chartName, version); err != nil { cra.SendInternalServerError(err) return @@ -408,7 +408,7 @@ func (cra *ChartRepositoryAPI) DeleteChart() { } func (cra *ChartRepositoryAPI) removeLabelsFromChart(chartName, version string) error { - // Try to remove labels from deleting chart if exitsing + // Try to remove labels from deleting chart if existing resourceID := chartFullName(cra.namespace, chartName, version) labels, err := cra.labelManager.GetLabelsOfResource(common.ResourceTypeChart, resourceID) if err == nil && len(labels) > 0 { @@ -432,7 +432,7 @@ func (cra *ChartRepositoryAPI) requireNamespace(namespace string) bool { return false } - existsing, err := cra.ProjectMgr.Exists(namespace) + existing, err := cra.ProjectMgr.Exists(namespace) if err != nil { // Check failed with error cra.SendInternalServerError(fmt.Errorf("failed to check existence of namespace %s with error: %s", namespace, err.Error())) @@ -440,7 +440,7 @@ func (cra *ChartRepositoryAPI) requireNamespace(namespace string) bool { } // Not existing - if !existsing { + if !existing { cra.SendBadRequestError(fmt.Errorf("namespace %s is not existing", namespace)) return false } diff --git a/src/core/api/label.go b/src/core/api/label.go index eb2aaaf88..db4636078 100644 --- a/src/core/api/label.go +++ b/src/core/api/label.go @@ -49,7 +49,7 @@ func (l *LabelAPI) Prepare() { if method == http.MethodPut || method == http.MethodDelete { id, err := l.GetInt64FromPath(":id") if err != nil || id <= 0 { - l.SendBadRequestError(errors.New("invalid lable ID")) + l.SendBadRequestError(errors.New("invalid label ID")) return } diff --git a/src/core/api/quota/migrator.go b/src/core/api/quota/migrator.go index cc32e0cf3..cc7b3b0c7 100644 --- a/src/core/api/quota/migrator.go +++ b/src/core/api/quota/migrator.go @@ -38,7 +38,7 @@ type QuotaMigrator interface { // Usage computes the quota usage of all the projects Usage([]ProjectInfo) ([]ProjectUsage, error) - // Persist record the data to DB, artifact, artifact_blob and blob tabel. + // Persist record the data to DB, artifact, artifact_blob and blob table. Persist([]ProjectInfo) error } diff --git a/src/core/api/repository.go b/src/core/api/repository.go index 8a40d5f49..6c1fa1483 100755 --- a/src/core/api/repository.go +++ b/src/core/api/repository.go @@ -271,7 +271,7 @@ func (ra *RepositoryAPI) Delete() { } log.Debugf("Tag: %s, digest: %s", t, digest) if _, ok := signedTags[digest]; ok { - log.Errorf("Found signed tag, repostory: %s, tag: %s, deletion will be canceled", repoName, t) + log.Errorf("Found signed tag, repository: %s, tag: %s, deletion will be canceled", repoName, t) ra.SendPreconditionFailedError(fmt.Errorf("tag %s is signed", t)) return } @@ -858,7 +858,7 @@ func getManifest(client *registry.Repository, return result, nil } -// GetTopRepos returns the most populor repositories +// GetTopRepos returns the most popular repositories func (ra *RepositoryAPI) GetTopRepos() { count, err := ra.GetInt("count", 10) if err != nil || count <= 0 { diff --git a/src/core/api/systeminfo.go b/src/core/api/systeminfo.go index a0929d545..30d798dd2 100644 --- a/src/core/api/systeminfo.go +++ b/src/core/api/systeminfo.go @@ -235,7 +235,7 @@ func getClairVulnStatus() *models.ClairVulnerabilityStatus { m := make(map[string]int64) for _, e := range l { ns := strings.Split(e.Namespace, ":") - // only returns the latest time of one distro, i.e. unbuntu:14.04 and ubuntu:15.4 shares one timestamp + // only returns the latest time of one distro, i.e. ubuntu:14.04 and ubuntu:15.4 shares one timestamp el := e.LastUpdate.UTC().Unix() if ts, ok := m[ns[0]]; !ok || ts < el { m[ns[0]] = el diff --git a/src/core/notifier/notification_handler.go b/src/core/notifier/notification_handler.go index 9bc893055..876521edb 100644 --- a/src/core/notifier/notification_handler.go +++ b/src/core/notifier/notification_handler.go @@ -8,7 +8,7 @@ type NotificationHandler interface { Handle(value interface{}) error // IsStateful returns whether the handler is stateful or not. - // If handler is stateful, it will not be triggerred in parallel. + // If handler is stateful, it will not be triggered in parallel. // Otherwise, the handler will be triggered concurrently if more // than one same handler are matched the topics. IsStateful() bool diff --git a/src/core/promgr/metamgr/metamgr.go b/src/core/promgr/metamgr/metamgr.go index 06ce99ba8..458e51637 100644 --- a/src/core/promgr/metamgr/metamgr.go +++ b/src/core/promgr/metamgr/metamgr.go @@ -26,7 +26,7 @@ type ProjectMetadataManager interface { Add(projectID int64, meta map[string]string) error // Delete metadatas whose keys are specified in parameter meta, if it // is absent, delete all - Delete(projecdtID int64, meta ...string) error + Delete(projectID int64, meta ...string) error // Update metadatas Update(projectID int64, meta map[string]string) error // Get metadatas whose keys are specified in parameter meta, if it is diff --git a/src/core/promgr/promgr.go b/src/core/promgr/promgr.go index 3ac8f6ca8..60661e020 100644 --- a/src/core/promgr/promgr.go +++ b/src/core/promgr/promgr.go @@ -25,7 +25,7 @@ import ( "github.com/goharbor/harbor/src/core/promgr/pmsdriver" ) -// ProjectManager is the project mamager which abstracts the operations related +// ProjectManager is the project manager which abstracts the operations related // to projects type ProjectManager interface { Get(projectIDOrName interface{}) (*models.Project, error) diff --git a/src/core/service/notifications/admin/handler.go b/src/core/service/notifications/admin/handler.go index 326c6b52d..cd85d3e46 100644 --- a/src/core/service/notifications/admin/handler.go +++ b/src/core/service/notifications/admin/handler.go @@ -35,7 +35,7 @@ var statusMap = map[string]string{ job.JobServiceStatusScheduled: models.JobScheduled, } -// Handler handles reqeust on /service/notifications/jobs/adminjob/*, which listens to the webhook of jobservice. +// Handler handles request on /service/notifications/jobs/adminjob/*, which listens to the webhook of jobservice. type Handler struct { api.BaseController id int64 diff --git a/src/core/service/notifications/jobs/handler.go b/src/core/service/notifications/jobs/handler.go index b383400b4..58d1054bf 100755 --- a/src/core/service/notifications/jobs/handler.go +++ b/src/core/service/notifications/jobs/handler.go @@ -41,7 +41,7 @@ var statusMap = map[string]string{ job.JobServiceStatusSuccess: models.JobFinished, } -// Handler handles reqeust on /service/notifications/jobs/*, which listens to the webhook of jobservice. +// Handler handles request on /service/notifications/jobs/*, which listens to the webhook of jobservice. type Handler struct { api.BaseController id int64 diff --git a/src/core/service/token/token.go b/src/core/service/token/token.go index 338d9ab49..e378363ee 100644 --- a/src/core/service/token/token.go +++ b/src/core/service/token/token.go @@ -29,7 +29,7 @@ type Handler struct { // Get handles GET request, it checks the http header for user credentials // and parse service and scope based on docker registry v2 standard, -// checkes the permission against local DB and generates jwt token. +// checks the permission against local DB and generates jwt token. func (h *Handler) Get() { request := h.Ctx.Request log.Debugf("URL for token request: %s", request.URL.String()) diff --git a/src/core/utils/utils.go b/src/core/utils/utils.go index e55f8a010..43d3dba1c 100644 --- a/src/core/utils/utils.go +++ b/src/core/utils/utils.go @@ -59,7 +59,7 @@ func newRepositoryClient(endpoint, username, repository string) (*registry.Repos return registry.NewRepository(repository, endpoint, client) } -// WaitForManifestReady implements exponential sleeep to wait until manifest is ready in registry. +// WaitForManifestReady implements exponential sleep to wait until manifest is ready in registry. // This is a workaround for https://github.com/docker/distribution/issues/2625 func WaitForManifestReady(repository string, tag string, maxRetry int) bool { // The initial wait interval, hard-coded to 80ms, interval will be 80ms,200ms,500ms,1.25s,3.124999936s