EDG-912: honour HIVEMQ_CONFIG_SECONDARY, gate base-dn, allow several LDAP servers - #1721
Open
marregui wants to merge 1 commit into
Open
EDG-912: honour HIVEMQ_CONFIG_SECONDARY, gate base-dn, allow several LDAP servers#1721marregui wants to merge 1 commit into
marregui wants to merge 1 commit into
Conversation
caoccao
approved these changes
Aug 19, 2026
Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found during a local QA run of the Helm chart against current Edge master. Details and evidence in EDG-912.
Not required for 2026.13. All three are pre-existing — identical code on
2026.12— and none affects a non-k8s deployment.1.
HIVEMQ_CONFIG_SECONDARYwas ignoredSystemInformationImpl.setFolders():The else-branch was a no-op: the secondary folder always equalled the primary one. Consequence in k8s — Edge read topic filters from
conf-k8sinstead of the chart'sconf-secondaryConfigMap, found none, and wrote an emptytopic-filters.xmlinto the primary folder. Anything declared intopicFilters:was invisible.Now calls
setUpHiveMQFolderdirectly.Blast radius is small and I checked it deliberately:
getSecondaryHiveMQHomeFolder()has exactly one production consumer,TopicFilterPersistenceReaderWriter. Deployments that do not set the variable are bit-for-bit unaffected. The persistence file now lands on a read-only ConfigMap mount, so I went looking for a write path that would start failing — there isn't one, all four write endpoints inTopicFilterResourceImplare guarded byisConfigWriteable()and the chart hardcodesHIVEMQ_CONFIG_WRITEABLE=false.2.
<base-dn>crash-looped when unsetdocker/config-k8s.xmlreferenced${ENV:HIVEMQ_LDAP_BASE_DN}unconditionally while the chart only sets it when configured, soEnvVarUtilaborted the boot.base-dnis genuinely optional —minOccurs="0", and its absence selects the documented legacy mode whererdnsis treated as an absolute DN.Wrapped in
${IF:HIVEMQ_LDAP_BASE_DN_ENABLED}and registered inIfUtil.SUPPORTED_ENVS, the same idiom already used forrequired-object-class.Rejected: having the chart emit an empty element.
base-dnis typednonEmptyString, so that trades a boot abort for a schema violation. Also rejected: makingbaseDnmandatory in the chart, which removes a supported Edge mode.3. More than one
<ldap-server>was schema-invalidmaxOccursdefaulted to 1, so a second entry failed withcvc-complex-type.2.4.d. Edge's own model is aList<LdapServerEntity>andLdapClientbuilds aRoundRobinServerSetover it, so the schema was the defect, not the model. NowmaxOccurs="unbounded".Merge order
Companion chart PR: hivemq/helm-charts#1039
HIVEMQ_LDAP_BASE_DNand the template renders the element unconditionally. Add the gate on this side alone and every user who has configured a base DN silently loses it and falls back to legacy resolution. Either both, or neither.config.xsdchange is safe to merge first and de-risks the chart PR — nobody can currently have a second<ldap-server>, so it cannot regress an existing config.SystemInformationImplfix is fully independent.Tests
ConfigK8sTemplateTestis new: it drives the realdocker/config-k8s.xmlthrough the actual render-and-validate pipeline with the environment the chart sets. This is the class of bug behind all three findings — a missing${IF:}gate deletes an element rather than failing — so it now has coverage.Each new test was confirmed to fail against the unfixed code:
SystemInformationImplTest— 3 of the 4 new casesConfigK8sTemplateTest.ldapWithoutABaseDn_isStillAValidConfigurationApiConfiguratorTest.ldapWithSeveralServers_isAccepted,ConfigK8sTemplateTest.ldapWithThreeServersAndATruststore_survivesTheTemplateFull local run of what
check-backend.ymlruns —:test :hivemq-edge:forbiddenApis :hivemqEdgeZip— 6389 tests, 0 failures, 3 skipped. Spotless clean via the composite. Verified end to end in kind against an image built from this branch.