Skip to content

Commit f39f907

Browse files
committed
adding newly introduced UserExternal to crtmqm
Removing redundant env variable in dockerfile userexternal only if gt 9201 restore env variable for UNKNOWN_ID
1 parent c37f8f1 commit f39f907

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Dockerfile-server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ RUN chown -R 1001:root /etc/mqm/* \
157157
&& install --directory --mode 2775 --owner 1001 --group root /run/runmqdevserver
158158
ENV MQ_ENABLE_EMBEDDED_WEB_SERVER=1 MQ_GENERATE_CERTIFICATE_HOSTNAME=localhost
159159
ENV LD_LIBRARY_PATH=/opt/mqm/lib64
160-
ENV MQS_PERMIT_UNKNOWN_ID=true
161160
ENV MQ_CONNAUTH_USE_HTP=true
161+
ENV MQS_PERMIT_UNKNOWN_ID=true
162162
USER 1001
163163
ENTRYPOINT ["runmqdevserver"]

cmd/runmqserver/qmgr.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,21 @@ func getQueueManagerDataDir(mounts map[string]string, name string) string {
203203
}
204204

205205
func getCreateQueueManagerArgs(mounts map[string]string, name string, devMode bool) []string {
206+
207+
// use "UserExternal" only if we are 9.2.0.1 or above.
208+
mqVersion, _, err := command.Run("dspmqver", "-b", "-f", "2")
209+
if err != nil {
210+
log.Printf("Error Getting MQ version to find oa: %v", strings.TrimSuffix(string(mqVersion), "\n"))
211+
}
212+
oaVal := "user"
213+
if mqVersion > "9.2.0.0" {
214+
oaVal = "UserExternal"
215+
}
216+
217+
//build args
206218
args := []string{"-ii", "/etc/mqm/", "-ic", "/etc/mqm/", "-q", "-p", "1414"}
207219
if devMode {
208-
args = append(args, "-oa", "user")
220+
args = append(args, "-oa", oaVal)
209221
}
210222
if _, ok := mounts["/mnt/mqm-log"]; ok {
211223
args = append(args, "-ld", "/mnt/mqm-log/log")

0 commit comments

Comments
 (0)