diff --git a/Dockerfile.builder b/Dockerfile.builder index 66256c03..e2642cf4 100644 --- a/Dockerfile.builder +++ b/Dockerfile.builder @@ -2,7 +2,7 @@ FROM centos:7 LABEL maintainer "Devtools " LABEL author "Konrad Kleine " ENV LANG=en_US.utf8 -ARG USE_GO_VERSION_FROM_WEBSITE=0 +ARG USE_GO_VERSION_FROM_WEBSITE=1 # Some packages might seem weird but they are required by the RVM installer. RUN yum --enablerepo=centosplus install -y --quiet \ @@ -18,11 +18,11 @@ RUN yum --enablerepo=centosplus install -y --quiet \ RUN test -n $USE_GO_VERSION_FROM_WEBSITE \ && cd /tmp \ - && wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz \ - && echo "b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33 go1.10.linux-amd64.tar.gz" > checksum \ + && wget https://dl.google.com/go/go1.11.1.linux-amd64.tar.gz \ + && echo "2871270d8ff0c8c69f161aaae42f9f28739855ff5c5204752a8d92a1c9f63993 go1.11.1.linux-amd64.tar.gz" > checksum \ && sha256sum -c checksum \ - && tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz \ - && rm -f go1.10.linux-amd64.tar.gz + && tar -C /usr/local -xzf go1.11.1.linux-amd64.tar.gz \ + && rm -f go1.11.1.linux-amd64.tar.gz ENV PATH=$PATH:/usr/local/go/bin # Get dep for Go package management and make sure the directory has full rwz permissions for non-root users diff --git a/account/repository/verification_code.go b/account/repository/verification_code.go index 602962f7..424087de 100644 --- a/account/repository/verification_code.go +++ b/account/repository/verification_code.go @@ -95,7 +95,7 @@ func (m *GormVerificationCodeRepository) Create(ctx context.Context, model *Veri if err != nil { log.Error(ctx, map[string]interface{}{ "verification_code_id": model.ID, - "err": err, + "err": err, }, "unable to create the verification_code") return errs.WithStack(err) } @@ -113,7 +113,7 @@ func (m *GormVerificationCodeRepository) Save(ctx context.Context, model *Verifi if err != nil { log.Error(ctx, map[string]interface{}{ "verification_code_id": model.ID, - "err": err, + "err": err, }, "unable to update the verification_code") return errs.WithStack(err) } @@ -136,7 +136,7 @@ func (m *GormVerificationCodeRepository) Delete(ctx context.Context, id uuid.UUI if result.Error != nil { log.Error(ctx, map[string]interface{}{ "verification_code_id": id, - "err": result.Error, + "err": result.Error, }, "unable to delete the verification_code") return errs.WithStack(result.Error) } diff --git a/authorization/resourcetype/repository/resource_type_scope.go b/authorization/resourcetype/repository/resource_type_scope.go index 46c599d3..2e463127 100644 --- a/authorization/resourcetype/repository/resource_type_scope.go +++ b/authorization/resourcetype/repository/resource_type_scope.go @@ -126,7 +126,7 @@ func (m *GormResourceTypeScopeRepository) Create(ctx context.Context, u *Resourc if err != nil { log.Error(ctx, map[string]interface{}{ "resource_type_scope_id": u.ResourceTypeScopeID, - "err": err, + "err": err, }, "unable to create the resource type scope") return errs.WithStack(err) } @@ -144,7 +144,7 @@ func (m *GormResourceTypeScopeRepository) Save(ctx context.Context, model *Resou if err != nil { log.Error(ctx, map[string]interface{}{ "resource_type_scope_id": model.ResourceTypeScopeID, - "err": err, + "err": err, }, "unable to update resource type scope") return errs.WithStack(err) } @@ -170,7 +170,7 @@ func (m *GormResourceTypeScopeRepository) Delete(ctx context.Context, id uuid.UU if result.Error != nil { log.Error(ctx, map[string]interface{}{ "resource_type_scope_id": id, - "err": result.Error, + "err": result.Error, }, "unable to delete the resource type scope") return errs.WithStack(result.Error) } diff --git a/authorization/role/repository/default_role_mapping.go b/authorization/role/repository/default_role_mapping.go index eb969f6d..5db2b58f 100644 --- a/authorization/role/repository/default_role_mapping.go +++ b/authorization/role/repository/default_role_mapping.go @@ -112,7 +112,7 @@ func (m *GormDefaultRoleMappingRepository) Create(ctx context.Context, u *Defaul if err != nil { log.Error(ctx, map[string]interface{}{ "default_role_mapping_id": u.DefaultRoleMappingID, - "err": err, + "err": err, }, "unable to create the default role mapping") return errs.WithStack(err) } @@ -159,7 +159,7 @@ func (m *GormDefaultRoleMappingRepository) Delete(ctx context.Context, id uuid.U if result.Error != nil { log.Error(ctx, map[string]interface{}{ "default_role_mapping_id": id, - "err": result.Error, + "err": result.Error, }, "unable to delete the default role mapping") return errs.WithStack(result.Error) } diff --git a/cico_build_deploy.sh b/cico_build_deploy.sh index 288e6188..1a533322 100644 --- a/cico_build_deploy.sh +++ b/cico_build_deploy.sh @@ -2,6 +2,8 @@ . cico_setup.sh +export USE_GO_VERSION_FROM_WEBSITE=1 + load_jenkins_vars if [ ! -f .cico-prepare ]; then diff --git a/cico_run_tests.sh b/cico_run_tests.sh index dd61064b..8ba98068 100644 --- a/cico_run_tests.sh +++ b/cico_run_tests.sh @@ -2,6 +2,8 @@ . cico_setup.sh +export USE_GO_VERSION_FROM_WEBSITE=1 + cico_setup; run_tests_without_coverage; diff --git a/controller/token.go b/controller/token.go index 66b9bb25..5e9f379d 100644 --- a/controller/token.go +++ b/controller/token.go @@ -56,7 +56,7 @@ func NewTokenController(service *goa.Service, app application.Application, auth TokenManager: tokenManager, Configuration: configuration, providerConfigFactory: providerConfigFactory, - app: app, + app: app, } } @@ -304,7 +304,7 @@ func (c *TokenController) retrieveClusterToken(ctx context.Context, forResource } if osConfig.OSOCluster().ServiceAccountUsername != userProfile.Username { log.Warn(ctx, map[string]interface{}{ - "for": forResource, + "for": forResource, "configuration_username": osConfig.OSOCluster().ServiceAccountUsername, "user_profile_username": userProfile.Username, }, "username from user profile for cluster token does not match username stored in configuration") diff --git a/controller/users.go b/controller/users.go index bae97fef..9b8bc1fa 100644 --- a/controller/users.go +++ b/controller/users.go @@ -523,8 +523,8 @@ func (c *UsersController) updateWITUser(ctx *app.UpdateUsersContext, identityID FullName: ctx.Payload.Data.Attributes.FullName, ImageURL: ctx.Payload.Data.Attributes.ImageURL, RegistrationCompleted: ctx.Payload.Data.Attributes.RegistrationCompleted, - URL: ctx.Payload.Data.Attributes.URL, - Username: ctx.Payload.Data.Attributes.Username, + URL: ctx.Payload.Data.Attributes.URL, + Username: ctx.Payload.Data.Attributes.Username, }, Type: ctx.Payload.Data.Type, }, diff --git a/login/link/keycloak_idp.go b/login/link/keycloak_idp.go index 69af6d5b..d8fbd976 100644 --- a/login/link/keycloak_idp.go +++ b/login/link/keycloak_idp.go @@ -59,7 +59,7 @@ func (c *KeycloakIDPServiceClient) Create(ctx context.Context, keycloakLinkIDPRe if err != nil { log.Error(ctx, map[string]interface{}{ "keycloak_idp_link_url": keycloakIDPLinkURL, - "err": err, + "err": err, }, "Unable to create idp link for RHD") return errors.NewInternalError(ctx, err) } else if resp != nil { diff --git a/login/profile.go b/login/profile.go index 87350f8f..ae3f1320 100644 --- a/login/profile.go +++ b/login/profile.go @@ -139,7 +139,7 @@ func (userProfileClient *KeycloakUserProfileClient) CreateOrUpdate(ctx context.C if err != nil { log.Error(ctx, map[string]interface{}{ "keycloak_user_profile_url": keycloakAdminUserAPIURL, - "err": err, + "err": err, }, "Unable to create Keycloak user") return nil, false, errors.NewInternalError(ctx, err) } else if resp != nil { @@ -345,7 +345,7 @@ func (userProfileClient *KeycloakUserProfileClient) Update(ctx context.Context, if err != nil { log.Error(ctx, map[string]interface{}{ "keycloak_user_profile_url": keycloakProfileURL, - "err": err, + "err": err, }, "Unable to update Keycloak user profile") return errors.NewInternalError(ctx, err) } else if resp != nil { @@ -398,7 +398,7 @@ func (userProfileClient *KeycloakUserProfileClient) Get(ctx context.Context, acc if err != nil { log.Error(ctx, map[string]interface{}{ "keycloak_user_profile_url": keycloakProfileURL, - "err": err, + "err": err, }, "Unable to fetch Keycloak user profile") return nil, errors.NewInternalError(ctx, err) } else if resp != nil { diff --git a/login/service.go b/login/service.go index dc601a05..5d15fc1a 100644 --- a/login/service.go +++ b/login/service.go @@ -53,10 +53,10 @@ type Configuration interface { // NewKeycloakOAuthProvider creates a new login.Service capable of using keycloak for authorization func NewKeycloakOAuthProvider(identities account.IdentityRepository, users account.UserRepository, tokenManager token.Manager, app application.Application, keycloakProfileService UserProfileService, osoSubscriptionManager OSOSubscriptionManager) *KeycloakOAuthProvider { return &KeycloakOAuthProvider{ - Identities: identities, - Users: users, - TokenManager: tokenManager, - App: app, + Identities: identities, + Users: users, + TokenManager: tokenManager, + App: app, keycloakProfileService: keycloakProfileService, osoSubscriptionManager: osoSubscriptionManager, } diff --git a/main.go b/main.go index b953eb4c..87c240eb 100644 --- a/main.go +++ b/main.go @@ -60,7 +60,7 @@ func main() { log.Panic(nil, map[string]interface{}{ "config_file": configFile, "service_account_config_file": serviceAccountConfigFile, - "err": err, + "err": err, }, "failed to setup the configuration") } diff --git a/wit/service/wit_service.go b/wit/service/wit_service.go index 6902e8bb..7d3e3afe 100644 --- a/wit/service/wit_service.go +++ b/wit/service/wit_service.go @@ -46,8 +46,8 @@ func (s *witServiceImpl) UpdateUser(ctx context.Context, updatePayload *app.Upda FullName: updatePayload.Data.Attributes.FullName, ImageURL: updatePayload.Data.Attributes.ImageURL, RegistrationCompleted: updatePayload.Data.Attributes.RegistrationCompleted, - URL: updatePayload.Data.Attributes.URL, - Username: updatePayload.Data.Attributes.Username, + URL: updatePayload.Data.Attributes.URL, + Username: updatePayload.Data.Attributes.Username, }, Type: updatePayload.Data.Type, },