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

Use golang 1.11 from epel #2378

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
12 changes: 2 additions & 10 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ 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=1

# Some packages might seem weird but they are required by the RVM installer.
RUN yum install epel-release -y \
&& yum install --enablerepo=centosplus install -y --quiet \
&& yum --enablerepo=centosplus --enablerepo=epel install -y --quiet \
kwk marked this conversation as resolved.
Show resolved Hide resolved
findutils \
git \
$(test "$USE_GO_VERSION_FROM_WEBSITE" != 1 && echo "golang") \
golang \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I highly object against this change. I explicitly want to be able to use Go from the website in order to test out new features in builds like the coverage for example. If you find that CentOS has ditched Golang as it appears, then please fix that problem and don't just remove the ability to use Go from the website.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I highly object against this change. I explicitly want to be able to use Go from the website in order to test out new features in builds like the coverage for example.

We can still test things via a PR, can't we? Even if we keep the flag, you'd still have to send a new PR if you want to test something :)

If you find that CentOS has ditched Golang as it appears, then please fix that problem and don't just remove the ability to use Go from the website.

Using golang from epel is exactly what we want. I wasn't part of the discussion where it was decided to use golang from epel and not website but it looks like most of our services have already migrated openshiftio/openshift.io#4618

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By testing I mean: Permanently use a feature (not only in one PR).

I'm not suggesting to not use Go from epel. I just want you to not remove the feature to be able to use Go from the website.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwk okay. That makes sense. I'll undo the removal of from-website flag.

make \
procps-ng \
tar \
Expand All @@ -19,13 +18,6 @@ RUN yum install epel-release -y \
postgresql \
&& yum clean all

RUN if [[ "$USE_GO_VERSION_FROM_WEBSITE" = 1 ]]; then cd /tmp \
&& wget --no-verbose https://dl.google.com/go/go1.9.4.linux-amd64.tar.gz \
&& echo "15b0937615809f87321a457bb1265f946f9f6e736c563d6c5e0bd2c22e44f779 go1.9.4.linux-amd64.tar.gz" > checksum \
&& sha256sum -c checksum \
&& tar -C /usr/local -xzf go1.9.4.linux-amd64.tar.gz \
&& rm -f go1.9.4.linux-amd64.tar.gz; \
fi
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
4 changes: 2 additions & 2 deletions auth/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func GetEntitlement(ctx context.Context, entitlementEndpoint string, entitlement
if err != nil {
log.Error(ctx, map[string]interface{}{
"entitlement_resource": entitlementResource,
"err": err.Error(),
"err": err.Error(),
}, "unable to marshal keycloak entitlement resource struct")
return nil, errors.NewInternalError(ctx, errs.Wrap(err, "unable to marshal keycloak entitlement resource struct"))
}
Expand All @@ -65,7 +65,7 @@ func GetEntitlement(ctx context.Context, entitlementEndpoint string, entitlement
if err != nil {
log.Error(ctx, map[string]interface{}{
"entitlement_resource": entitlementResource,
"err": err.Error(),
"err": err.Error(),
}, "unable to obtain entitlement resource")
return nil, errors.NewInternalError(ctx, errs.Wrap(err, "unable to obtain entitlement resource"))
}
Expand Down
3 changes: 0 additions & 3 deletions cico_run_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

. cico_setup.sh

# Use go1.11 (or newer from epel)
kwk marked this conversation as resolved.
Show resolved Hide resolved
export USE_GO_VERSION_FROM_WEBSITE=0

cico_setup;

run_tests_with_coverage;
2 changes: 1 addition & 1 deletion controller/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (g *defaultClientGetter) GetAndCheckOSIOClient(ctx context.Context) (Opensh
if err != nil {
log.Error(ctx, map[string]interface{}{
"FABRIC8_WIT_API_URL": witURLStr,
"err": err,
"err": err,
}, "cannot parse FABRIC8_WIT_API_URL: %s", witURLStr)
return nil, errs.Wrapf(err, "cannot parse FABRIC8_WIT_API_URL: %s", witURLStr)
}
Expand Down
4 changes: 2 additions & 2 deletions controller/work_item_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func newWorkItemLinkContext(ctx context.Context, service *goa.Service, appl appl
Context: ctx,
Service: service,
CurrentUserIdentityID: currentUserIdentityID,
DB: db,
LinkFunc: linkFunc,
DB: db,
LinkFunc: linkFunc,
}
}

Expand Down
6 changes: 3 additions & 3 deletions login/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (keycloak *KeycloakOAuthProvider) CreateOrUpdateKeycloakUser(accessToken st
if err != nil {
log.Error(ctx, map[string]interface{}{
"keycloak_identity_id": keycloakIdentityID,
"err": err,
"err": err,
}, "unable to query for an identity by ID")
return nil, nil, errors.New("Error during querying for an identity by ID " + err.Error())
}
Expand All @@ -84,7 +84,7 @@ func (keycloak *KeycloakOAuthProvider) CreateOrUpdateKeycloakUser(accessToken st
if err != nil {
log.Error(ctx, map[string]interface{}{
"keycloak_identity_id": keycloakIdentityID,
"err": err,
"err": err,
}, "unable to create user/identity")
return nil, nil, errors.New("failed to update user/identity from claims" + err.Error())
}
Expand Down Expand Up @@ -126,7 +126,7 @@ func (keycloak *KeycloakOAuthProvider) CreateOrUpdateKeycloakUser(accessToken st
if err != nil {
log.Error(ctx, map[string]interface{}{
"keycloak_identity_id": keycloakIdentityID,
"err": err,
"err": err,
}, "unable to create user/identity")
return nil, nil, errs.Wrapf(err, "failed to update user/identity from claims")
} else if isChanged {
Expand Down
22 changes: 11 additions & 11 deletions search/search_repository_whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,18 @@ func TestGetSearchQueryFromURLString(t *testing.T) {

func TestIsOperator(t *testing.T) {
testData := map[string]bool{
AND: true,
OR: true,
OPTS: false,
"": false,
" ": false,
"foo": false,
AND: true,
OR: true,
OPTS: false,
"": false,
" ": false,
"foo": false,
uuid.NewV4().String(): false,
EQ: false,
NE: false,
NOT: false,
IN: false,
SUBSTR: false,
EQ: false,
NE: false,
NOT: false,
IN: false,
SUBSTR: false,
}
for k, v := range testData {
t.Run(k, func(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions test/recorder/recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func newJWTMatcher(publicKey string) cassette.Matcher {
return true
}
log.Debug(nil, map[string]interface{}{
"method": cassetteRequest.Method,
"url": cassetteRequest.URL,
"method": cassetteRequest.Method,
"url": cassetteRequest.URL,
"cassetteRequest_sub": sub,
"http_request_sub": claims["sub"],
}, "Authorization header's 'sub' claim doesn't match with the current request")
Expand Down