Skip to content

Update readOnly configuration in registry.xml.j2 to use dynamic values#14169

Open
Tharanidk wants to merge 1 commit intowso2:masterfrom
Tharanidk:readonly-fix
Open

Update readOnly configuration in registry.xml.j2 to use dynamic values#14169
Tharanidk wants to merge 1 commit intowso2:masterfrom
Tharanidk:readonly-fix

Conversation

@Tharanidk
Copy link
Copy Markdown
Contributor

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b490f23-6f28-493b-818a-16c04ca7d74e

📥 Commits

Reviewing files that changed from the base of the PR and between 86f5cae and cefc4d3.

📒 Files selected for processing (1)
  • traffic-manager/modules/distribution/product/src/main/resources/conf/templates/repository/conf/registry.xml.j2

📝 Walkthrough

Summary

Updated the registry configuration template to enable dynamic control over registry settings via TOML configuration.

Changes

Modified traffic-manager/modules/distribution/product/src/main/resources/conf/templates/repository/conf/registry.xml.j2 to replace static values with Jinja2 template expressions:

  • Updated the readOnly value for the governance registry remote instance from hardcoded false to {{governance_data.readonly}}
  • Updated the readOnly value for the configuration registry remote instance from hardcoded false to {{config_data.readonly}}

Impact

These changes enable the Traffic Manager distribution to respect TOML configuration settings for registry overwrite behavior. Previously, the static template values prevented the TOML settings [config_data].overwrite and [governance_data].overwrite from taking effect. With this update, these configuration options now properly control whether the respective registries can be overwritten, allowing users to prevent unintended registry modifications through TOML configuration files.

Walkthrough

The registry.xml.j2 template file in the traffic-manager distribution has been updated to support dynamic configuration of read-only settings. Two <remoteInstance> entries—one for governance registry and one for configuration registry—now reference template variables ({{governance_data.readonly}} and {{config_data.readonly}}) instead of static false values. This enables these settings to be controlled through TOML configuration files rather than requiring manual template edits.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially addresses the linked issue #4935 by making readOnly values dynamic, but does not implement the complete solution requiring J2 template entries for cacheId, enableCache, and registryRoot. Add missing J2 template expressions for cacheId ({{governance_data.cache_id}}, {{config_data.cache_id}}), enableCache ({{governance_data.enable_cache}}, {{config_data.enable_cache}}), and registryRoot to fully resolve issue #4935.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating readOnly configuration to use dynamic template values instead of static literals.
Description check ✅ Passed The description references the linked issue #4935, which is directly related to the changeset and its objectives.
Out of Scope Changes check ✅ Passed All changes are scoped to the registry.xml.j2 template file and directly address the configuration updates mentioned in the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[APIM 4.5.0] Missing J2 template configurations in TM distribution

2 participants