diff --git a/src/common/models/config.go b/src/common/models/config.go index cac64bf68..6d120cea7 100644 --- a/src/common/models/config.go +++ b/src/common/models/config.go @@ -77,7 +77,7 @@ type TokenService struct { // SystemCfg holds all configurations of system type SystemCfg struct { - DomainName string `json:"domain_name"` // Harbor external URL: protocal://host:port + DomainName string `json:"domain_name"` // Harbor external URL: protocol://host:port Authentication *Authentication `json:"authentication"` Database *Database `json:"database"` TokenService *TokenService `json:"token_service"` diff --git a/src/common/models/project.go b/src/common/models/project.go index 7af7ba1ac..8e6305362 100644 --- a/src/common/models/project.go +++ b/src/common/models/project.go @@ -115,7 +115,7 @@ func isTrue(value string) bool { // List projects the owner of which is user1: query := &QueryParam{Owner:"user1"} // List all public projects the owner of which is user1: query := &QueryParam{Owner:"user1",Public:true} // List projects which user1 is member of: query := &QueryParam{Member:&Member{Name:"user1"}} -// List projects which user1 is the project admin : query := &QueryParam{Memeber:&Member{Name:"user1",Role:1}} +// List projects which user1 is the project admin : query := &QueryParam{Member:&Member{Name:"user1",Role:1}} type ProjectQueryParam struct { Name string // the name of project Owner string // the username of project owner diff --git a/src/common/scheduler/scheduler.go b/src/common/scheduler/scheduler.go index c8d0c9a07..2cc878a1e 100644 --- a/src/common/scheduler/scheduler.go +++ b/src/common/scheduler/scheduler.go @@ -56,7 +56,7 @@ type Configuration struct { //Scheduler is designed for scheduling policies. type Scheduler struct { - //Mutex for sync controling. + //Mutex for sync controlling. *sync.RWMutex //Related configuration options for scheduler. diff --git a/src/common/utils/clair/client.go b/src/common/utils/clair/client.go index 9622323b0..48b79d156 100644 --- a/src/common/utils/clair/client.go +++ b/src/common/utils/clair/client.go @@ -121,7 +121,7 @@ func (c *Client) GetNotification(id string) (*models.ClairNotification, error) { if ne.Error != nil { return nil, fmt.Errorf("Clair error: %s", ne.Error.Message) } - log.Debugf("Retrived notification %s from Clair.", id) + log.Debugf("Retrieved notification %s from Clair.", id) return ne.Notification, nil } diff --git a/src/common/utils/uaa/client.go b/src/common/utils/uaa/client.go index f1ad462e4..2dd1a36b3 100644 --- a/src/common/utils/uaa/client.go +++ b/src/common/utils/uaa/client.go @@ -98,7 +98,7 @@ type SearchUserRes struct { Schemas []string `json:"schemas"` } -// DefaultClient leverages oauth2 pacakge for oauth features +// DefaultClient leverages oauth2 package for oauth features type defaultClient struct { httpClient *http.Client oauth2Cfg *oauth2.Config diff --git a/src/jobservice/env/context.go b/src/jobservice/env/context.go index 58c104e3d..910426672 100644 --- a/src/jobservice/env/context.go +++ b/src/jobservice/env/context.go @@ -5,7 +5,7 @@ import ( "sync" ) -//Context keep some sharable materials and system controling channels. +//Context keep some sharable materials and system controlling channels. //The system context.Context interface is also included. type Context struct { //The system context with cancel capability. diff --git a/src/jobservice/job/impl/gc/job.go b/src/jobservice/job/impl/gc/job.go index 42dfbf13a..35a3b5114 100644 --- a/src/jobservice/job/impl/gc/job.go +++ b/src/jobservice/job/impl/gc/job.go @@ -72,7 +72,7 @@ func (gc *GarbageCollector) Run(ctx env.JobContext, params map[string]interface{ } defer gc.readonly(false) if err := gc.registryCtlClient.Health(); err != nil { - gc.logger.Errorf("failed to start gc as regsitry controller is unreachable: %v", err) + gc.logger.Errorf("failed to start gc as registry controller is unreachable: %v", err) return err } gc.logger.Infof("start to run gc in job.") diff --git a/src/jobservice/period/redis_scheduler.go b/src/jobservice/period/redis_scheduler.go index 1bec7abc3..2d1a3abc5 100644 --- a/src/jobservice/period/redis_scheduler.go +++ b/src/jobservice/period/redis_scheduler.go @@ -255,7 +255,7 @@ func (rps *RedisPeriodicScheduler) Load() error { if pid, ok := keyScoreMap[score]; ok { policy.PolicyID = pid } else { - //Something wrong, should not be happended + //Something wrong, should not be happened //ignore here continue } diff --git a/src/jobservice/pool/message_server.go b/src/jobservice/pool/message_server.go index 44773f2e7..f360037e3 100644 --- a/src/jobservice/pool/message_server.go +++ b/src/jobservice/pool/message_server.go @@ -82,7 +82,7 @@ func (ms *MessageServer) Start() error { switch m.Event { case period.EventSchedulePeriodicPolicy, period.EventUnSchedulePeriodicPolicy: - //ignore error, actually error should not be happend because we did not change data + //ignore error, actually error should not be happened because we did not change data //after the last unmarshal try. policyObject := &period.PeriodicJobPolicy{} dt, _ := json.Marshal(m.Data) diff --git a/src/jobservice/utils/gocarft_work.go b/src/jobservice/utils/gocarft_work.go index 0dc8bf0bc..73a6148ba 100644 --- a/src/jobservice/utils/gocarft_work.go +++ b/src/jobservice/utils/gocarft_work.go @@ -28,7 +28,7 @@ func MakeUniquePeriodicID(name, spec string, epoch int64) string { return fmt.Sprintf("periodic:job:%s:%s:%d", name, spec, epoch) } -//RedisNamespacePrefix ... Same with 'KeyNamespacePrefix', only for compatiblity. +//RedisNamespacePrefix ... Same with 'KeyNamespacePrefix', only for compatibility. func RedisNamespacePrefix(namespace string) string { return KeyNamespacePrefix(namespace) } diff --git a/src/registryctl/client/client.go b/src/registryctl/client/client.go index e79ff2eb2..17da31f1c 100644 --- a/src/registryctl/client/client.go +++ b/src/registryctl/client/client.go @@ -28,7 +28,7 @@ import ( "github.com/goharbor/harbor/src/registryctl/api" ) -// Client defines methods that an Regsitry client should implement +// Client defines methods that an Registry client should implement type Client interface { // Health tests the connection with registry server Health() error diff --git a/src/registryctl/client/client_test.go b/src/registryctl/client/client_test.go index 5e10b5dae..7f9c02b50 100644 --- a/src/registryctl/client/client_test.go +++ b/src/registryctl/client/client_test.go @@ -29,7 +29,7 @@ func TestMain(m *testing.M) { server, err := test.NewRegistryCtl(nil) if err != nil { - fmt.Printf("failed to create regsitry: %v", err) + fmt.Printf("failed to create registry: %v", err) os.Exit(1) } diff --git a/src/registryctl/handlers/handler.go b/src/registryctl/handlers/handler.go index 5f7734dd1..89bbb48f2 100644 --- a/src/registryctl/handlers/handler.go +++ b/src/registryctl/handlers/handler.go @@ -54,7 +54,7 @@ func newAuthHandler(authenticator auth.AuthenticationHandler, handler http.Handl func (a *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if a.authenticator == nil { - log.Errorf("No authenticator found in regsitry controller.") + log.Errorf("No authenticator found in registry controller.") http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return diff --git a/src/replication/core/controller.go b/src/replication/core/controller.go index acc6bfe62..58e8cb1e8 100644 --- a/src/replication/core/controller.go +++ b/src/replication/core/controller.go @@ -142,7 +142,7 @@ func (ctl *DefaultController) UpdatePolicy(updatedPolicy models.ReplicationPolic reset = true } case replication.TriggerKindImmediate: - // Always reset immediate trigger as it is relevent with namespaces + // Always reset immediate trigger as it is relevant with namespaces reset = true default: // manual trigger, no need to reset diff --git a/src/replication/trigger/interface.go b/src/replication/trigger/interface.go index d08e75137..38f1f317c 100644 --- a/src/replication/trigger/interface.go +++ b/src/replication/trigger/interface.go @@ -1,6 +1,6 @@ package trigger -//Interface is certian mechanism to know when fire the replication operation. +//Interface is certain mechanism to know when fire the replication operation. type Interface interface { //Kind indicates what type of the trigger is. Kind() string diff --git a/src/replication/trigger/schedule.go b/src/replication/trigger/schedule.go index 419eb21d5..4238b612d 100644 --- a/src/replication/trigger/schedule.go +++ b/src/replication/trigger/schedule.go @@ -46,7 +46,7 @@ func (st *ScheduleTrigger) Setup() error { h, m, s := common_utils.ParseOfftime(st.params.Offtime) metadata.Cron = fmt.Sprintf("%d %d %d * * %d", s, m, h, st.params.Weekday%7) default: - return fmt.Errorf("unsupported schedual trigger type: %s", st.params.Type) + return fmt.Errorf("unsupported schedule trigger type: %s", st.params.Type) } id, err := dao.AddRepJob(models.RepJob{ diff --git a/src/ui/api/harborapi_test.go b/src/ui/api/harborapi_test.go index a9834fe9d..3b36a87ab 100644 --- a/src/ui/api/harborapi_test.go +++ b/src/ui/api/harborapi_test.go @@ -363,7 +363,7 @@ func (a testapi) ProjectsHead(prjUsr usrInfo, projectName string) (int, error) { return httpStatusCode, err } -//Return specific project detail infomation +//Return specific project detail information func (a testapi) ProjectsGetByPID(projectID string) (int, apilib.Project, error) { _sling := sling.New().Get(a.basePath) diff --git a/src/ui/api/models/reg_gc.go b/src/ui/api/models/reg_gc.go index ce7c1650a..a498d7c87 100644 --- a/src/ui/api/models/reg_gc.go +++ b/src/ui/api/models/reg_gc.go @@ -85,7 +85,7 @@ func (gr *GCReq) ToJob() (*models.JobData, error) { metadata.Cron = fmt.Sprintf("%d %d %d * * %d", s, m, h, gr.Schedule.Weekday%7) case ScheduleManual, ScheduleNone: default: - return nil, fmt.Errorf("unsupported schedual trigger type: %s", gr.Schedule.Type) + return nil, fmt.Errorf("unsupported schedule trigger type: %s", gr.Schedule.Type) } jobData := &models.JobData{ diff --git a/src/ui/api/project_test.go b/src/ui/api/project_test.go index 4e101d696..3a85c7c65 100644 --- a/src/ui/api/project_test.go +++ b/src/ui/api/project_test.go @@ -83,15 +83,15 @@ func TestAddProject(t *testing.T) { //t.Log(result) } - //case 4: reponse code = 400 : Project name is illegal in length - fmt.Println("case 4 : reponse code = 400 : Project name is illegal in length ") + //case 4: response code = 400 : Project name is illegal in length + fmt.Println("case 4 : response code = 400 : Project name is illegal in length ") result, err = apiTest.ProjectsPost(*admin, apilib.ProjectReq{"t", map[string]string{models.ProMetaPublic: "true"}}) if err != nil { t.Error("Error while creat project", err.Error()) t.Log(err) } else { - assert.Equal(int(400), result, "case 4 : reponse code = 400 : Project name is illegal in length ") + assert.Equal(int(400), result, "case 4 : response code = 400 : Project name is illegal in length ") } fmt.Printf("\n") diff --git a/src/ui/api/reg_gc_test.go b/src/ui/api/reg_gc_test.go index e36acfb80..5e064114f 100644 --- a/src/ui/api/reg_gc_test.go +++ b/src/ui/api/reg_gc_test.go @@ -18,7 +18,7 @@ func TestAdminJobPost(t *testing.T) { //case 1: add a new admin job code, err := apiTest.AddGC(*admin, adminJob001) if err != nil { - t.Error("Error occured while add a admin job", err.Error()) + t.Error("Error occurred while add a admin job", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Add adminjob status should be 200") @@ -31,7 +31,7 @@ func TestAdminJobGet(t *testing.T) { code, _, err := apiTest.GCScheduleGet(*admin) if err != nil { - t.Error("Error occured while get a admin job", err.Error()) + t.Error("Error occurred while get a admin job", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Get adminjob status should be 200") diff --git a/src/ui/api/repository_test.go b/src/ui/api/repository_test.go index 7a9a77679..068586f55 100644 --- a/src/ui/api/repository_test.go +++ b/src/ui/api/repository_test.go @@ -44,7 +44,7 @@ func TestGetRepos(t *testing.T) { assert.Equal(int(1), len(repos), "the length of repositories should be 1") assert.Equal(repos[0].Name, "library/hello-world", "unexpected repository name") } else { - t.Error("unexpected reponse") + t.Error("unexpected response") } } diff --git a/src/ui/api/systeminfo.go b/src/ui/api/systeminfo.go index 5f51c8d5f..71e01044a 100644 --- a/src/ui/api/systeminfo.go +++ b/src/ui/api/systeminfo.go @@ -156,7 +156,7 @@ func (sia *SystemInfoAPI) GetCert() { func (sia *SystemInfoAPI) GetGeneralInfo() { cfg, err := config.GetSystemCfg() if err != nil { - log.Errorf("Error occured getting config: %v", err) + log.Errorf("Error occurred getting config: %v", err) sia.CustomAbort(http.StatusInternalServerError, "Unexpected error") } var registryURL string @@ -198,7 +198,7 @@ func (sia *SystemInfoAPI) GetGeneralInfo() { func (sia *SystemInfoAPI) getVersion() string { version, err := ioutil.ReadFile(harborVersionFile) if err != nil { - log.Errorf("Error occured getting harbor version: %v", err) + log.Errorf("Error occurred getting harbor version: %v", err) return "" } return string(version[:]) diff --git a/src/ui/api/systeminfo_test.go b/src/ui/api/systeminfo_test.go index 6f2edafd4..170e47102 100644 --- a/src/ui/api/systeminfo_test.go +++ b/src/ui/api/systeminfo_test.go @@ -30,7 +30,7 @@ func TestGetVolumeInfo(t *testing.T) { CommonAddUser() code, _, err := apiTest.VolumeInfoGet(*testUser) if err != nil { - t.Error("Error occured while get system volume info") + t.Error("Error occurred while get system volume info") t.Log(err) } else { assert.Equal(403, code, "Get system volume info should be 403") @@ -38,7 +38,7 @@ func TestGetVolumeInfo(t *testing.T) { //case 2: get volume info with admin role code, info, err := apiTest.VolumeInfoGet(*admin) if err != nil { - t.Error("Error occured while get system volume info") + t.Error("Error occurred while get system volume info") t.Log(err) } else { assert.Equal(200, code, "Get system volume info should be 200") @@ -75,7 +75,7 @@ func TestGetCert(t *testing.T) { //case 1: get cert without admin role code, _, err := apiTest.CertGet(*testUser) if err != nil { - t.Error("Error occured while get system cert") + t.Error("Error occurred while get system cert") t.Log(err) } else { assert.Equal(403, code, "Get system cert should be 403") @@ -83,7 +83,7 @@ func TestGetCert(t *testing.T) { //case 2: get cert with admin role code, content, err := apiTest.CertGet(*admin) if err != nil { - t.Error("Error occured while get system cert") + t.Error("Error occurred while get system cert") t.Log(err) } else { assert.Equal(200, code, "Get system cert should be 200") diff --git a/src/ui/api/user_test.go b/src/ui/api/user_test.go index 6fb4cf227..da00001b3 100644 --- a/src/ui/api/user_test.go +++ b/src/ui/api/user_test.go @@ -44,7 +44,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user without admin auth") code, err := apiTest.UsersPost(testUser0002) if err != nil { - t.Error("Error occured while add a test User", err.Error()) + t.Error("Error occurred while add a test User", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Add user status should be 400") @@ -54,7 +54,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user with admin auth, but username is empty") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Add user status should be 400") @@ -65,7 +65,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user with admin auth, but bad username format") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Add user status should be 400") @@ -76,7 +76,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user with admin auth, but empty password.") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Add user status should be 400") @@ -87,7 +87,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user with admin auth, but email is empty") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Add user status should be 400") @@ -98,7 +98,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user with admin auth, but bad email format") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Add user status should be 400") @@ -110,7 +110,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user with admin auth, but user realname is empty") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Add user status should be 400") @@ -122,7 +122,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user with admin auth, but bad user realname format") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { @@ -135,7 +135,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register user with admin auth, but user comment length is illegal") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Add user status should be 400") @@ -146,7 +146,7 @@ func TestUsersPost(t *testing.T) { testUser0002.Comment = "test user" code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(201, code, "Add user status should be 201") @@ -156,7 +156,7 @@ func TestUsersPost(t *testing.T) { fmt.Println("Register duplicate user with admin auth") code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(409, code, "Add user status should be 409") @@ -168,7 +168,7 @@ func TestUsersPost(t *testing.T) { testUser0002.Email = "testUser0002@mydomain.com" code, err = apiTest.UsersPost(testUser0002, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(409, code, "Add user status should be 409") @@ -187,7 +187,7 @@ func TestUsersGet(t *testing.T) { testUser0002Auth = &usrInfo{"testUser0002", "testUser0002"} code, users, err := apiTest.UsersGet(testUser0002.Username, *testUser0002Auth) if err != nil { - t.Error("Error occured while get users", err.Error()) + t.Error("Error occurred while get users", err.Error()) t.Log(err) } else { assert.Equal(403, code, "Get users status should be 403") @@ -195,7 +195,7 @@ func TestUsersGet(t *testing.T) { //case 2: Get user2 with admin auth, expect 200 code, users, err = apiTest.UsersGet(testUser0002.Username, *admin) if err != nil { - t.Error("Error occured while get users", err.Error()) + t.Error("Error occurred while get users", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Get users status should be 200") @@ -213,7 +213,7 @@ func TestUsersGetByID(t *testing.T) { //case 1: Get user2 with userID and his own auth, expect 200 code, user, err := apiTest.UsersGetByID(testUser0002.Username, *testUser0002Auth, testUser0002ID) if err != nil { - t.Error("Error occured while get users", err.Error()) + t.Error("Error occurred while get users", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Get users status should be 200") @@ -227,7 +227,7 @@ func TestUsersGetByID(t *testing.T) { testUser0003.Realname = "testUser0003" code, err = apiTest.UsersPost(testUser0003, *admin) if err != nil { - t.Error("Error occured while add a user", err.Error()) + t.Error("Error occurred while add a user", err.Error()) t.Log(err) } else { assert.Equal(201, code, "Add user status should be 201") @@ -236,7 +236,7 @@ func TestUsersGetByID(t *testing.T) { testUser0003Auth = &usrInfo{"testUser0003", "testUser0003"} code, user, err = apiTest.UsersGetByID(testUser0002.Username, *testUser0003Auth, testUser0002ID) if err != nil { - t.Error("Error occured while get users", err.Error()) + t.Error("Error occurred while get users", err.Error()) t.Log(err) } else { assert.Equal(403, code, "Get users status should be 403") @@ -244,7 +244,7 @@ func TestUsersGetByID(t *testing.T) { //case 3: Get user that does not exist with user2 auth, expect 404 not found. code, user, err = apiTest.UsersGetByID(testUser0002.Username, *testUser0002Auth, 1000) if err != nil { - t.Error("Error occured while get users", err.Error()) + t.Error("Error occurred while get users", err.Error()) t.Log(err) } else { assert.Equal(404, code, "Get users status should be 404") @@ -252,7 +252,7 @@ func TestUsersGetByID(t *testing.T) { // Get user3ID in order to delete at the last of the test code, users, err := apiTest.UsersGet(testUser0003.Username, *admin) if err != nil { - t.Error("Error occured while get users", err.Error()) + t.Error("Error occurred while get users", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Get users status should be 200") @@ -269,7 +269,7 @@ func TestUsersPut(t *testing.T) { //case 1: change user2 profile with user3 auth code, err := apiTest.UsersPut(testUser0002ID, profile, *testUser0003Auth) if err != nil { - t.Error("Error occured while change user profile", err.Error()) + t.Error("Error occurred while change user profile", err.Error()) t.Log(err) } else { assert.Equal(403, code, "Change user profile status should be 403") @@ -277,7 +277,7 @@ func TestUsersPut(t *testing.T) { //case 2: change user2 profile with user2 auth, but bad parameters format. code, err = apiTest.UsersPut(testUser0002ID, profile, *testUser0002Auth) if err != nil { - t.Error("Error occured while change user profile", err.Error()) + t.Error("Error occurred while change user profile", err.Error()) t.Log(err) } else { assert.Equal(400, code, "Change user profile status should be 400") @@ -288,7 +288,7 @@ func TestUsersPut(t *testing.T) { profile.Comment = "change profile" code, err = apiTest.UsersPut(testUser0002ID, profile, *testUser0002Auth) if err != nil { - t.Error("Error occured while change user profile", err.Error()) + t.Error("Error occurred while change user profile", err.Error()) t.Log(err) } else { assert.Equal(409, code, "Change user profile status should be 409") @@ -299,7 +299,7 @@ func TestUsersPut(t *testing.T) { profile.Comment = "change profile" code, err = apiTest.UsersPut(testUser0002ID, profile, *testUser0002Auth) if err != nil { - t.Error("Error occured while change user profile", err.Error()) + t.Error("Error occurred while change user profile", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Change user profile status should be 200") @@ -314,7 +314,7 @@ func TestUsersToggleAdminRole(t *testing.T) { //case 1: toggle user2 admin role without admin auth code, err := apiTest.UsersToggleAdminRole(testUser0002ID, *testUser0002Auth, true) if err != nil { - t.Error("Error occured while toggle user admin role", err.Error()) + t.Error("Error occurred while toggle user admin role", err.Error()) t.Log(err) } else { assert.Equal(403, code, "Toggle user admin role status should be 403") @@ -322,7 +322,7 @@ func TestUsersToggleAdminRole(t *testing.T) { //case 2: toggle user2 admin role with admin auth code, err = apiTest.UsersToggleAdminRole(testUser0002ID, *admin, true) if err != nil { - t.Error("Error occured while toggle user admin role", err.Error()) + t.Error("Error occurred while toggle user admin role", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Toggle user admin role status should be 200") @@ -491,7 +491,7 @@ func TestUsersDelete(t *testing.T) { //case 1:delete user without admin auth code, err := apiTest.UsersDelete(testUser0002ID, *testUser0003Auth) if err != nil { - t.Error("Error occured while delete test user", err.Error()) + t.Error("Error occurred while delete test user", err.Error()) t.Log(err) } else { assert.Equal(403, code, "Delete test user status should be 403") @@ -500,7 +500,7 @@ func TestUsersDelete(t *testing.T) { t.Log("delete user-case 2") code, err = apiTest.UsersDelete(testUser0002ID, *testUser0002Auth) if err != nil { - t.Error("Error occured while delete test user", err.Error()) + t.Error("Error occurred while delete test user", err.Error()) t.Log(err) } else { assert.Equal(403, code, "Delete test user status should be 403") @@ -509,7 +509,7 @@ func TestUsersDelete(t *testing.T) { t.Log("delete user-case 3") code, err = apiTest.UsersDelete(testUser0002ID, *admin) if err != nil { - t.Error("Error occured while delete test user", err.Error()) + t.Error("Error occurred while delete test user", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Delete test user status should be 200") @@ -517,7 +517,7 @@ func TestUsersDelete(t *testing.T) { //delete user3 with admin auth code, err = apiTest.UsersDelete(testUser0003ID, *admin) if err != nil { - t.Error("Error occured while delete test user", err.Error()) + t.Error("Error occurred while delete test user", err.Error()) t.Log(err) } else { assert.Equal(200, code, "Delete test user status should be 200") diff --git a/src/ui/proxy/interceptors.go b/src/ui/proxy/interceptors.go index 6aa896837..099e49a7e 100644 --- a/src/ui/proxy/interceptors.go +++ b/src/ui/proxy/interceptors.go @@ -192,7 +192,7 @@ func (lrh listReposHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) } var entries []string for repo := range ctlg.Repositories { - log.Debugf("the repo in the reponse %s", ctlg.Repositories[repo]) + log.Debugf("the repo in the response %s", ctlg.Repositories[repo]) exist := dao.RepositoryExists(ctlg.Repositories[repo]) if exist { entries = append(entries, ctlg.Repositories[repo]) diff --git a/src/ui/service/token/token.go b/src/ui/service/token/token.go index 8546b201e..5dd33c60d 100644 --- a/src/ui/service/token/token.go +++ b/src/ui/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 agains local DB and generates jwt token. +// checkes 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/ui/utils/response_handlers.go b/src/ui/utils/response_handlers.go index 64761601d..5a10e3dce 100644 --- a/src/ui/utils/response_handlers.go +++ b/src/ui/utils/response_handlers.go @@ -59,7 +59,7 @@ type JobLogRespHandler struct { theAPI *api.BaseAPI } -//Handle will consume the response of job service and put the content of the job log in the reponse of the API. +//Handle will consume the response of job service and put the content of the job log in the response of the API. func (h JobLogRespHandler) Handle(resp *http.Response) error { defer resp.Body.Close() if resp.StatusCode == http.StatusOK { @@ -75,7 +75,7 @@ func (h JobLogRespHandler) Handle(resp *http.Response) error { b, err := ioutil.ReadAll(resp.Body) if err != nil { - log.Errorf("failed to read reponse body: %v", err) + log.Errorf("failed to read response body: %v", err) return err } h.theAPI.RenderError(resp.StatusCode, fmt.Sprintf("message from jobservice: %s", string(b)))