From 40a9bdf712270fc84a0239985e55d93dc6f47a21 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Wed, 22 Jan 2025 17:04:10 +0000 Subject: [PATCH] [#1086] use cr.name as broker name in restricted mode --- controllers/activemqartemis_reconciler.go | 2 +- pkg/utils/artemis/artemis.go | 4 ++-- pkg/utils/jolokia_client/jolokia_client.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/activemqartemis_reconciler.go b/controllers/activemqartemis_reconciler.go index 3b7c5e3d..8121db19 100644 --- a/controllers/activemqartemis_reconciler.go +++ b/controllers/activemqartemis_reconciler.go @@ -2036,7 +2036,7 @@ func (reconciler *ActiveMQArtemisReconcilerImpl) PodTemplateSpecForCR(customReso brokerPropertiesMapData["_cert-roles"] = cert_roles.String() foundationalProps := newPropsWithHeader() - fmt.Fprintln(foundationalProps, "name=amq-broker") + fmt.Fprintf(foundationalProps, "name=%s\n", customResource.Name) fmt.Fprintln(foundationalProps, "criticalAnalyzer=false") fmt.Fprintln(foundationalProps, "journalDirectory=/app/data") fmt.Fprintln(foundationalProps, "bindingsDirectory=/app/data/bindings") diff --git a/pkg/utils/artemis/artemis.go b/pkg/utils/artemis/artemis.go index 89fb2e00..f6c5e54b 100644 --- a/pkg/utils/artemis/artemis.go +++ b/pkg/utils/artemis/artemis.go @@ -49,11 +49,11 @@ type Artemis struct { jolokia jolokia.IJolokia } -func GetArtemisAgentForRestricted(client rtclient.Client, ordinalFqdn string) *Artemis { +func GetArtemisAgentForRestricted(client rtclient.Client, brokerName string, ordinalFqdn string) *Artemis { artemis := Artemis{ ip: ordinalFqdn, jolokiaPort: jolokia.JOLOKIA_AGENT_PORT, - name: "amq-broker", + name: brokerName, jolokia: jolokia.GetRestrictedJolokia(client, ordinalFqdn, jolokia.JOLOKIA_AGENT_PORT, "/jolokia"), } return &artemis diff --git a/pkg/utils/jolokia_client/jolokia_client.go b/pkg/utils/jolokia_client/jolokia_client.go index 69667616..0a66a848 100644 --- a/pkg/utils/jolokia_client/jolokia_client.go +++ b/pkg/utils/jolokia_client/jolokia_client.go @@ -69,7 +69,7 @@ func GetMinimalJolokiaAgents(cr *v1beta1.ActiveMQArtemis, client rtclient.Client ordinalFqdn := common.OrdinalFQDNS(cr.Name, cr.Namespace, i) - artemis := mgmt.GetArtemisAgentForRestricted(client, ordinalFqdn) + artemis := mgmt.GetArtemisAgentForRestricted(client, cr.Name, ordinalFqdn) jkInfo := JkInfo{ Artemis: artemis,