Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Upgrade to go v11.1 for test-coverage CI (#709)
Browse files Browse the repository at this point in the history
* Upgrade to go v11.1 for test-coverage CI

* Switch to go v.11.1 for all builds

* Always use go from website
  • Loading branch information
alexeykazakov authored and sbryzak committed Nov 1, 2018
1 parent f3b1ea5 commit 6c338ab
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 28 deletions.
10 changes: 5 additions & 5 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM centos:7
LABEL maintainer "Devtools <[email protected]>"
LABEL author "Konrad Kleine <[email protected]>"
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 \
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions account/repository/verification_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions authorization/resourcetype/repository/resource_type_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions authorization/role/repository/default_role_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 2 additions & 0 deletions cico_build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

. cico_setup.sh

export USE_GO_VERSION_FROM_WEBSITE=1

load_jenkins_vars

if [ ! -f .cico-prepare ]; then
Expand Down
2 changes: 2 additions & 0 deletions cico_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

. cico_setup.sh

export USE_GO_VERSION_FROM_WEBSITE=1

cico_setup;

run_tests_without_coverage;
4 changes: 2 additions & 2 deletions controller/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func NewTokenController(service *goa.Service, app application.Application, auth
TokenManager: tokenManager,
Configuration: configuration,
providerConfigFactory: providerConfigFactory,
app: app,
app: app,
}
}

Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions controller/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion login/link/keycloak_idp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions login/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions login/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
4 changes: 2 additions & 2 deletions wit/service/wit_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit 6c338ab

Please sign in to comment.