Skip to content

[Misc] Remove TENANT_HOST_PATTERN template from values.yaml #83

Open
anirudhprasad-sap wants to merge 3 commits intomainfrom
cap-op-plugin-update
Open

[Misc] Remove TENANT_HOST_PATTERN template from values.yaml #83
anirudhprasad-sap wants to merge 3 commits intomainfrom
cap-op-plugin-update

Conversation

@anirudhprasad-sap
Copy link
Contributor

@anirudhprasad-sap anirudhprasad-sap commented Feb 5, 2026

  • Remove TENANT_HOST_PATTERN template value from the Router workload values.yaml and update the corresponding templates

…ted templates

[Feat] Handle multiple xsuaa instance during runtime-values.yaml generation
@hyperspace-insights
Copy link
Contributor

hyperspace-insights bot commented Feb 5, 2026

Summary

The following content is AI-generated and provides a summary of the pull request:


Refactor TENANT_HOST_PATTERN Handling and Simplify Values.yaml Generation

♻️ Refactor

This pull request refactors how the TENANT_HOST_PATTERN environment variable is managed during Helm chart generation and simplifies the logic for transforming values between values.yaml and the CAP Operator CRO templates.

Changes

  • lib/mta-transformer.js:

    • Removed automatic injection of TENANT_HOST_PATTERN template value during MTA transformation
    • Added logic to explicitly remove any existing TENANT_HOST_PATTERN entries from Router workload environment variables
    • Shifted responsibility for TENANT_HOST_PATTERN management to the runtime values generation phase
  • lib/util.js:

    • Introduced helper functions to improve code maintainability:
      • upsertEnvVar(): Adds or updates environment variables in workload definitions
      • extractAndReplaceHanaInstanceId(): Extracts HANA instance IDs from CDS_CONFIG and replaces them with template placeholders
      • appendToSpec(): Appends sections to the CAP Operator CRO YAML spec
    • Refactored transformValuesAndFillCapOpCroYaml() to use these helpers
    • Consolidated duplicate logic for handling TENANT_HOST_PATTERN across Router workloads
    • Simplified image placeholder replacement logic
    • Improved handling of tenantOperations, contentJobs, and serviceExposures migration using a loop
    • Enhanced getServiceInstanceKeyName() with more concise null-safe implementation
  • test/files/expectedChart/valuesWithMTA.yaml:

    • Removed TENANT_HOST_PATTERN from the Router workload's environment variables in test expectations, reflecting the new approach where this value is added at runtime
  • test/files/expectedConfigurableTemplatesChart/templates/cap-operator-cros-mta.yaml:

    • Updated test expectations to show TENANT_HOST_PATTERN is now correctly positioned at the end of the Router workload's environment variables array after runtime transformation

Summary

This refactoring consolidates the handling of TENANT_HOST_PATTERN to a single location (runtime values generation) rather than having it split between MTA transformation and runtime phases. The changes also improve code quality through the introduction of reusable helper functions and more maintainable logic patterns.


  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.17.50 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Output Template: Default Template
  • Summary Prompt: Default Prompt
  • LLM: anthropic--claude-4.5-sonnet
  • Event Trigger: issue_comment.edited
  • Correlation ID: 046c1730-02a8-11f1-8826-c716601d40d6

Copy link
Contributor

@hyperspace-insights hyperspace-insights bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pull Request implements support for multiple XSUAA instances and removes TENANT_HOST_PATTERN from values.yaml. The code changes include refactoring and a new feature. I identified several substantive issues including missing null checks that could cause runtime errors, an unused variable, and a missing error handler for JSON parsing. These issues should be addressed to improve code robustness and maintainability.

PR Bot Information

Version: 1.17.50 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Event Trigger: pull_request.opened
  • LLM: anthropic--claude-4.5-sonnet
  • Correlation ID: 7d368790-029e-11f1-9248-1171939fdee4

…dd null checks in service instance functions
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

@anirudhprasad-sap anirudhprasad-sap changed the title [Misc] Remove TENANT_HOST_PATTERN template from values.yaml and multiple xsuaa instance handling during runtime values generation [Misc] Remove TENANT_HOST_PATTERN template from values.yaml Feb 5, 2026
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.

1 participant