Skip to content

Commit eb5f862

Browse files
authored
11.0.0.11-r2 update (#150)
1 parent 9b964ab commit eb5f862

28 files changed

+64
-60
lines changed

cmd/runaceserver/integrationserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/ot4i/ace-docker/internal/command"
2828
"github.com/ot4i/ace-docker/internal/name"
2929
"github.com/ot4i/ace-docker/internal/qmgr"
30-
"github.com/ot4i/ace-docker/internal/contentserver"
30+
"github.com/ot4i/ace-docker/common/contentserver"
3131
"gopkg.in/yaml.v2"
3232
)
3333

cmd/runaceserver/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"io/ioutil"
2121
"os"
2222

23-
"github.com/ot4i/ace-docker/internal/logger"
23+
"github.com/ot4i/ace-docker/common/logger"
2424
)
2525

2626
var log logger.LoggerInterface

cmd/runaceserver/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/ot4i/ace-docker/internal/metrics"
2727
"github.com/ot4i/ace-docker/internal/name"
2828
"github.com/ot4i/ace-docker/internal/qmgr"
29-
"github.com/ot4i/ace-docker/internal/designer"
29+
"github.com/ot4i/ace-docker/common/designer"
3030
)
3131

3232
func doMain() error {

cmd/runaceserver/main_internal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"strconv"
2424
"testing"
2525

26-
"github.com/ot4i/ace-docker/internal/logger"
26+
"github.com/ot4i/ace-docker/common/logger"
2727
)
2828

2929
var test *bool

internal/contentserver/bar.go renamed to common/contentserver/bar.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"net/http"
2323
"io"
2424

25-
"github.com/ot4i/ace-docker/internal/logger"
25+
"github.com/ot4i/ace-docker/common/logger"
2626
)
2727

2828
var loadX509KeyPair = tls.LoadX509KeyPair
@@ -69,6 +69,7 @@ func GetBAR(url string, serverName string, token string, contentServerCACert []b
6969
}
7070
// TODO: this doesn't actually return an error
7171
if response.StatusCode != 200 {
72+
log.Printf("Call to retrieve BAR file from content server failed with response code: %v", response.StatusCode)
7273
return nil, err
7374
}
7475

internal/contentserver/bar_test.go renamed to common/contentserver/bar_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"io/ioutil"
2828
"bytes"
2929

30-
"github.com/ot4i/ace-docker/internal/logger"
30+
"github.com/ot4i/ace-docker/common/logger"
3131

3232
"github.com/stretchr/testify/assert"
3333
"testing"

internal/designer/flow_validation.go renamed to common/designer/flow_validation.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"gopkg.in/yaml.v2"
2626

2727
"github.com/ot4i/ace-docker/internal/command"
28-
"github.com/ot4i/ace-docker/internal/logger"
28+
"github.com/ot4i/ace-docker/common/logger"
2929
)
3030

3131
var runAsUser = command.RunAsUser
@@ -140,27 +140,26 @@ func getConnectorLicenseToggleName(name string) string {
140140
// findDisabledConnectorInFlow returns the first disabled connector it finds
141141
// if it doesn't find a disabled connector, it returns an empty string
142142
var findDisabledConnectorInFlow = func (flowDocument flowDocument, log logger.LoggerInterface) string {
143+
disabledConnectors := make([]string, 0)
144+
143145
// read the connector-type field under each interface
144146
// and check if the license toggle for that connector is enabled
145-
findDisabledConnector := func (interfaces map[string]flowInterface) string {
147+
findDisabledConnector := func(interfaces map[string]flowInterface) {
146148
for _, i := range interfaces {
147149
connector := i.ConnectorType
148150
if connector != "" {
149151
log.Printf("Checking if connector %v is supported under the current license.", connector)
150152
if !isLicenseToggleEnabled(getConnectorLicenseToggleName(connector)) {
151-
return connector
153+
disabledConnectors = append(disabledConnectors, connector)
152154
}
153155
}
154156
}
155-
return ""
156157
}
157158

158-
disabledTriggerConnector := findDisabledConnector(flowDocument.Integration.TriggerInterfaces)
159-
if disabledTriggerConnector != "" {
160-
return disabledTriggerConnector
161-
}
162-
disabledActionConnector := findDisabledConnector(flowDocument.Integration.ActionInterfaces)
163-
return disabledActionConnector
159+
findDisabledConnector(flowDocument.Integration.TriggerInterfaces)
160+
findDisabledConnector(flowDocument.Integration.ActionInterfaces)
161+
162+
return strings.Join(disabledConnectors[:], ", ")
164163
}
165164

166165
// IsFlowValid checks if a single flow is valid
@@ -172,11 +171,11 @@ var IsFlowValid = func(log logger.LoggerInterface, flow string, flowFile []byte)
172171
return false, err
173172
}
174173

175-
disabledConnector := findDisabledConnectorInFlow(flowDocument, log)
176-
if disabledConnector != "" {
177-
log.Errorf("Flow %v contains a %v connector, which isn't supported under the current license. Please update your license to enable this flow to run.", flow, disabledConnector)
174+
disabledConnectors := findDisabledConnectorInFlow(flowDocument, log)
175+
if disabledConnectors != "" {
176+
log.Errorf("Flow %v contains one or more connectors, which aren't supported under the current license. Please update your license to enable this flow to run. The unsupported connectors are: %v.", flow, disabledConnectors)
178177
}
179-
return disabledConnector == "", nil
178+
return disabledConnectors == "", nil
180179
}
181180

182181
// ValidateFlows checks if the flows in the /run directory are valid

internal/designer/flow_validation_test.go renamed to common/designer/flow_validation_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"io"
2323
"io/ioutil"
2424

25-
"github.com/ot4i/ace-docker/internal/logger"
25+
"github.com/ot4i/ace-docker/common/logger"
2626

2727
"github.com/stretchr/testify/assert"
2828
"github.com/stretchr/testify/require"
@@ -80,7 +80,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
8080
},
8181
},
8282
}
83-
require.Equal(t, "foo", findDisabledConnectorInFlow(testFlowDocument, testLogger))
83+
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
84+
require.Equal(t, "foo", disabledConnectors)
8485
})
8586

8687
t.Run("When there are unsupported connectors in the action interface", func(t *testing.T) {
@@ -101,7 +102,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
101102
},
102103
},
103104
}
104-
require.Equal(t, "bar", findDisabledConnectorInFlow(testFlowDocument, testLogger))
105+
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
106+
require.Equal(t, "bar", disabledConnectors)
105107
})
106108

107109
t.Run("When there are unsupported connectors in both the trigger interface and the action interface", func(t *testing.T) {
@@ -125,7 +127,8 @@ func TestFindDisabledConnectorInFlow(t *testing.T) {
125127
},
126128
},
127129
}
128-
require.Equal(t, "foo", findDisabledConnectorInFlow(testFlowDocument, testLogger))
130+
disabledConnectors := findDisabledConnectorInFlow(testFlowDocument, testLogger)
131+
require.Equal(t, "foo, bar", disabledConnectors)
129132
})
130133

131134
isLicenseToggleEnabled = oldIsLicenseToggleEnabled
File renamed without changes.

internal/logger/logger_test.go renamed to common/logger/logger_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strings"
2323
"testing"
2424

25-
"github.com/ot4i/ace-docker/internal/logger"
25+
"github.com/ot4i/ace-docker/common/logger"
2626
)
2727

2828
func TestJSONLogger(t *testing.T) {

internal/command/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"strings"
2929
"syscall"
3030

31-
"github.com/ot4i/ace-docker/internal/logger"
31+
"github.com/ot4i/ace-docker/common/logger"
3232
)
3333

3434
// A BackgroundCmd provides a handle to a backgrounded command and its completion state.

internal/configuration/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"path/filepath"
1313
"strings"
1414

15-
"github.com/ot4i/ace-docker/internal/logger"
15+
"github.com/ot4i/ace-docker/common/logger"
1616
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1717
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
1818
"k8s.io/apimachinery/pkg/runtime/schema"

internal/configuration/configuration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"os"
99
"testing"
1010

11-
"github.com/ot4i/ace-docker/internal/logger"
11+
"github.com/ot4i/ace-docker/common/logger"
1212
"github.com/stretchr/testify/assert"
1313
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
1414
"k8s.io/client-go/dynamic"

internal/configuration/techConnectorsConfiguration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
"github.com/aymerick/raymond"
1313
"github.com/ghodss/yaml"
14-
"github.com/ot4i/ace-docker/internal/logger"
14+
"github.com/ot4i/ace-docker/common/logger"
1515
)
1616

1717
// Credentials structure for jdbc credentials object, can be extended for other tech connectors

internal/metrics/exporter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ limitations under the License.
1818
package metrics
1919

2020
import (
21-
"github.com/ot4i/ace-docker/internal/logger"
21+
"github.com/ot4i/ace-docker/common/logger"
2222

2323
"github.com/prometheus/client_golang/prometheus"
2424
)

internal/metrics/exporter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
"github.com/prometheus/client_golang/prometheus"
2323
dto "github.com/prometheus/client_model/go"
24-
"github.com/ot4i/ace-docker/internal/logger"
24+
"github.com/ot4i/ace-docker/common/logger"
2525
)
2626

2727
func getTestLogger() logger.LoggerInterface {

internal/metrics/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"net/http"
2424
"time"
2525

26-
"github.com/ot4i/ace-docker/internal/logger"
26+
"github.com/ot4i/ace-docker/common/logger"
2727

2828
"github.com/prometheus/client_golang/prometheus"
2929
"github.com/prometheus/client_golang/prometheus/promhttp"

internal/metrics/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"strings"
3535
"sync"
3636

37-
"github.com/ot4i/ace-docker/internal/logger"
37+
"github.com/ot4i/ace-docker/common/logger"
3838

3939
"github.com/gorilla/websocket"
4040
"github.com/prometheus/client_golang/prometheus"

internal/qmgr/qmgr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"time"
2323

2424
"github.com/ot4i/ace-docker/internal/command"
25-
"github.com/ot4i/ace-docker/internal/logger"
25+
"github.com/ot4i/ace-docker/common/logger"
2626
)
2727

2828
// UseQueueManager returns a boolean for whether or not the system is using a queue manager.

sample/Dockerfile.aceonly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ USER root
55
COPY bars_aceonly /home/aceuser/bars
66
RUN chmod -R ugo+rwx /home/aceuser
77

8-
USER aceuser
8+
USER 1000
99

1010
RUN ace_compile_bars.sh
1111

1212
USER root
1313

1414
RUN chmod -R ugo+rwx /home/aceuser
1515

16-
USER aceuser
16+
USER 1000

ubi/Dockerfile.acemq

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ RUN go mod download
1212

1313
COPY cmd/ ./cmd
1414
COPY internal/ ./internal
15+
COPY common/ ./common
1516
RUN go build -ldflags "-X \"main.ImageCreated=$(date --iso-8601=seconds)\" -X \"main.ImageRevision=$IMAGE_REVISION\" -X \"main.ImageSource=$IMAGE_SOURCE\"" ./cmd/runaceserver/
1617
RUN go build ./cmd/chkaceready/
1718
RUN go build ./cmd/chkacehealthy/
1819
# Run all unit tests
1920
RUN go test -v ./cmd/runaceserver/
2021
RUN go test -v ./internal/...
21-
RUN go vet ./cmd/... ./internal/...
22+
RUN go test -v ./common/...
23+
RUN go vet ./cmd/... ./internal/... ./common/...
2224

2325
ARG ACE_INSTALL=ace-11.0.0.8.tar.gz
2426
WORKDIR /opt/ibm

ubi/Dockerfile.aceonly

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN go mod download
1010

1111
COPY cmd/ ./cmd
1212
COPY internal/ ./internal
13+
COPY common/ ./common
1314
RUN go version
1415
RUN go build -ldflags "-X \"main.ImageCreated=$(date --iso-8601=seconds)\" -X \"main.ImageRevision=$IMAGE_REVISION\" -X \"main.ImageSource=$IMAGE_SOURCE\"" ./cmd/runaceserver/
1516
RUN go build ./cmd/chkaceready/
@@ -18,7 +19,8 @@ RUN go build ./cmd/chkacehealthy/
1819
# Run all unit tests
1920
RUN go test -v ./cmd/runaceserver/
2021
RUN go test -v ./internal/...
21-
RUN go vet ./cmd/... ./internal/...
22+
RUN go test -v ./common/...
23+
RUN go vet ./cmd/... ./internal/... ./common/...
2224

2325
ARG ACE_INSTALL=ace-11.0.0.8.tar.gz
2426
ARG IFIX_LIST=""
@@ -55,16 +57,16 @@ LABEL summary="$SUMMARY" \
5557
# Add required license as text file in Liceses directory (GPL, MIT, APACHE, Partner End User Agreement, etc)
5658
COPY /licenses/ /licenses/
5759

60+
RUN microdnf update && microdnf install findutils util-linux unzip python3 tar procps openssl && microdnf clean all \
61+
&& ln -s /usr/bin/python3 /usr/local/bin/python \
62+
&& mkdir /etc/ACEOpenTracing /opt/ACEOpenTracing /var/log/ACEOpenTracing && chmod 777 /var/log/ACEOpenTracing /etc/ACEOpenTracing
63+
5864
# Create OpenTracing directories, update permissions and copy in any library or configuration files needed
59-
RUN mkdir /etc/ACEOpenTracing /opt/ACEOpenTracing /var/log/ACEOpenTracing && chmod 777 /var/log/ACEOpenTracing /etc/ACEOpenTracing
6065
COPY deps/OpenTracing/library/* ./opt/ACEOpenTracing/
6166
COPY deps/OpenTracing/config/* ./etc/ACEOpenTracing/
6267

6368
WORKDIR /opt/ibm
6469

65-
RUN microdnf update && microdnf install findutils util-linux unzip python3 tar procps && microdnf clean all
66-
67-
RUN ln -s /usr/bin/python3 /usr/local/bin/python
6870
COPY --from=builder /opt/ibm/ace-11 /opt/ibm/ace-11
6971

7072
# Copy in PID1 process
@@ -79,6 +81,10 @@ COPY ubi/install-kubectl.sh /usr/local/bin/
7981
RUN chmod u+x /usr/local/bin/install-kubectl.sh \
8082
&& install-kubectl.sh
8183

84+
COPY ubi/generic_invalid/invalid_license.msgflow /home/aceuser/temp/gen
85+
COPY ubi/generic_invalid/InvalidLicenseJava.jar /home/aceuser/temp/gen
86+
COPY ubi/generic_invalid/application.descriptor /home/aceuser/temp
87+
8288
# Create a user to run as, create the ace workdir, and chmod script files
8389
RUN /opt/ibm/ace-11/ace make registry global accept license silently \
8490
&& useradd -u 1000 -d /home/aceuser -G mqbrkrs,wheel aceuser \
@@ -87,14 +93,8 @@ RUN /opt/ibm/ace-11/ace make registry global accept license silently \
8793
&& su - -c '. /opt/ibm/ace-11/server/bin/mqsiprofile && mqsicreateworkdir /home/aceuser/ace-server' \
8894
&& chmod -R 777 /home/aceuser \
8995
&& chmod -R 777 /var/mqsi \
90-
&& su - -c '. /opt/ibm/ace-11/server/bin/mqsiprofile && echo $MQSI_JREPATH && chmod g+w $MQSI_JREPATH/lib/security/cacerts'
91-
92-
RUN mkdir /home/aceuser/temp
93-
RUN mkdir /home/aceuser/temp/gen
94-
COPY ubi/generic_invalid/invalid_license.msgflow /home/aceuser/temp/gen
95-
COPY ubi/generic_invalid/InvalidLicenseJava.jar /home/aceuser/temp/gen
96-
COPY ubi/generic_invalid/application.descriptor /home/aceuser/temp
97-
RUN chmod -R 777 /home/aceuser/temp
96+
&& su - -c '. /opt/ibm/ace-11/server/bin/mqsiprofile && echo $MQSI_JREPATH && chmod g+w $MQSI_JREPATH/lib/security/cacerts' \
97+
&& chmod -R 777 /home/aceuser/temp
9898

9999
# Set BASH_ENV to source mqsiprofile when using docker exec bash -c
100100
ENV BASH_ENV=/usr/local/bin/ace_env.sh
@@ -107,7 +107,7 @@ WORKDIR /home/aceuser
107107
ENV LOG_FORMAT=basic
108108

109109
# Set user to prevent container running as root by default
110-
USER aceuser
110+
USER 1000
111111

112112
# Set entrypoint to run management script
113113

ubi/Dockerfile.connectors

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN mkdir -p /opt/ibm/ace-11/node_modules
77
COPY deps/package-connectors.json /opt/ibm/ace-11/package.json
88
RUN export PATH=$PATH:/opt/ibm/ace-11/common/node/bin \
99
&& cd /opt/ibm/ace-11/node_modules \
10-
&& npm install loopback-connector-mongodb loopback-connector-postgresql --save
11-
RUN chown -R aceuser:mqbrkrs /opt/ibm/ace-11/node_modules
10+
&& npm install loopback-connector-mongodb loopback-connector-postgresql --save \
11+
&& chown -R aceuser:mqbrkrs /opt/ibm/ace-11/node_modules
1212

13-
USER aceuser
13+
USER 1000

ubi/Dockerfile.mqclient

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ COPY ubi/install-mq-client-prereqs.sh /usr/local/bin/
4242
RUN chmod u+x /usr/local/bin/install-*.sh \
4343
&& sleep 1 \
4444
&& install-mq-client-prereqs.sh $MQM_UID \
45-
&& install-mq.sh $MQM_UID
46-
47-
RUN mkdir /home/aceuser/truststores
45+
&& install-mq.sh $MQM_UID \
46+
&& mkdir /home/aceuser/truststores
4847
COPY --from=truststore-builder /tmp/mqcacerts.kdb /home/aceuser/truststores/mqcacerts.kdb
49-
RUN chmod -R 777 /home/aceuser/truststores
48+
RUN chmod -R 777 /home/aceuser/truststores \
5049
# Set the integration server to use it by default. A user provided server.conf.yaml will override this behaviour if the mqKeyRepository property is set.
51-
RUN sed -i 's/#.*mqKeyRepository:.*/mqKeyRepository: \/home\/aceuser\/truststores\/mqcacerts/g' /home/aceuser/ace-server/server.conf.yaml
50+
&& sed -i 's/#.*mqKeyRepository:.*/mqKeyRepository: \/home\/aceuser\/truststores\/mqcacerts/g' /home/aceuser/ace-server/server.conf.yaml
5251

5352
ENV MQCERTLABL=aceclient
5453

55-
USER aceuser
54+
USER 1000
34 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)