Skip to content

Commit 03cdf67

Browse files
committed
Merge branch 'UserExternal' into MQ-921-upgrade
2 parents e8e86dc + a3e3b0d commit 03cdf67

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Dockerfile-server

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

cmd/runmqserver/qmgr.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/ibm-messaging/mq-container/internal/command"
2828
containerruntime "github.com/ibm-messaging/mq-container/internal/containerruntime"
2929
"github.com/ibm-messaging/mq-container/internal/mqscredact"
30+
"github.com/ibm-messaging/mq-container/internal/mqversion"
3031
"github.com/ibm-messaging/mq-container/internal/ready"
3132
)
3233

@@ -203,9 +204,24 @@ func getQueueManagerDataDir(mounts map[string]string, name string) string {
203204
}
204205

205206
func getCreateQueueManagerArgs(mounts map[string]string, name string, devMode bool) []string {
207+
208+
mqversionBase := "9.2.1.0"
209+
210+
// use "UserExternal" only if we are 9.2.1.0 or above.
211+
oaVal := "user"
212+
mqVersionCheck, err := mqversion.Compare(mqversionBase)
213+
214+
if err != nil {
215+
log.Printf("Error comparing MQ versions for oa,rc: %v", mqVersionCheck)
216+
}
217+
if mqVersionCheck >= 0 {
218+
oaVal = "UserExternal"
219+
}
220+
221+
//build args
206222
args := []string{"-ii", "/etc/mqm/", "-ic", "/etc/mqm/", "-q", "-p", "1414"}
207223
if devMode {
208-
args = append(args, "-oa", "user")
224+
args = append(args, "-oa", oaVal)
209225
}
210226
if _, ok := mounts["/mnt/mqm-log"]; ok {
211227
args = append(args, "-ld", "/mnt/mqm-log/log")

0 commit comments

Comments
 (0)