8000 fix(ingress): support optional tls secretName and dynamic backend port in template by Gabriel-Ladzaretti · Pull Request #706 · mend/renovate-ce-ee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(ingress): support optional tls secretName and dynamic backend port in template #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 6, 2025

Conversation

Gabriel-Ladzaretti
Copy link
Contributor
@Gabriel-Ladzaretti Gabriel-Ladzaretti commented May 5, 2025

Changes

Support optional tls secretName and dynamic backend port in template
this allows for configuring TLS passthrough via SNI, with TLS termination handled by the backend service.

Example Configuration values.yaml

with mend-renovate-enterprise-edition and ingress-nginx as subchart dependencies:

ingress-nginx:
  controller:
    extraArgs:
      "enable-ssl-passthrough": ""



mend-renovate-enterprise-edition:

<redacted>

  ingress:
    enabled: true

    ingressClassName: nginx

    annotations:
      nginx.ingress.kubernetes.io/ssl-passthrough: "true"
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

    hosts:
      test.local:
        paths:
          - path: "/"
            pathType: ImplementationSpecific
            port:
              number: 443

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of optional fields in Ingress configuration to prevent empty or invalid values from being rendered.
    • Enhanced template robustness for TLS and service port settings in Helm charts.
  • Chores
    • Updated Helm chart versions for mend-renovate-ce and mend-renovate-enterprise-edition.

@Gabriel-Ladzaretti Gabriel-Ladzaretti requested a review from a team as a code owner May 5, 2025 15:59
Copy link
coderabbitai bot commented May 5, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The changes update the ingress YAML templates for both the Community Edition and Enterprise Edition Helm charts. The TLS configuration was modified to include the secretName field only if .secretName is defined, preventing the insertion of empty or undefined values. In the backend service port specification, the rendering is now conditional: if a port value is provided, it is output with proper YAML indentation; otherwise, the port defaults to the name "http." These modifications add conditional checks to avoid rendering invalid or empty fields in the generated YAML manifests. Additionally, the Helm chart versions for mend-renovate-ce and mend-renovate-ee were incremented from 9.10.0 to 9.10.1 and from 3.10.0 to 3.10.1 respectively. There are no changes to any exported or public entities.

Suggested reviewers

  • nabeelsaabna

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9b3753 and bbd9b30.

📒 Files selected for processing (2)
  • helm-charts/mend-renovate-ce/Chart.yaml (1 hunks)
  • helm-charts/mend-renovate-ee/Chart.yaml (1 hunks)

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
helm-charts/mend-renovate-ee/templates/ingress.yaml (2)

28-30: Quote secretName for safety
Although the conditional guard prevents empty values, wrapping .secretName in quote ensures any special characters or dashes are handled correctly by the YAML parser.

-      {{- if .secretName }}
-      secretName: {{ .secretName }}
-      {{- end }}
+      {{- if .secretName }}
+      secretName: {{ .secretName | quote }}
+      {{- end }}

45-49: Use nindent for multi-line port mappings
Applying indent to the output of toYaml can misalign nested YAML when $p.port expands to multiple lines. Prefer nindent to include the leading newline and correct indentation level.

-                  {{- if $p.port }}
-                  {{ toYaml $p.port | indent 8 }}
-                  {{- else }}
-                  name: http
-                  {{- end }}
+                  {{- if $p.port }}
+                  {{ toYaml $p.port | nindent 12 }}
+                  {{- else }}
+                  name: http
+                  {{- end }}
helm-charts/mend-renovate-ce/templates/ingress.yaml (2)

28-30: Quote secretName for safety
Mirroring the EE chart, quoting .secretName avoids YAML parsing errors if the secret name contains special characters.

-      {{- if .secretName }}
-      secretName: {{ .secretName }}
-      {{- end }}
+      {{- if .secretName }}
+      secretName: {{ .secretName | quote }}
+      {{- end }}

45-49: Switch to nindent for robust port rendering
Using indent on toYaml output may break nested structures. Replace with nindent to ensure the port block stays correctly indented, especially when $p.port has multiple lines.

-                  {{- if $p.port }}
-                  {{ toYaml $p.port | indent 8 }}
-                  {{- else }}
-                  name: http
-                  {{- end }}
+                  {{- if $p.port }}
+                  {{ toYaml $p.port | nindent 10 }}
+                  {{- else }}
+                  name: http
+                  {{- end }}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72ea714 and 70c74b2.

📒 Files selected for processing (2)
  • helm-charts/mend-renovate-ce/templates/ingress.yaml (2 hunks)
  • helm-charts/mend-renovate-ee/templates/ingress.yaml (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*`: - Feedback will only be given on issues that could cause bugs or involve very bad practices. - Comments will be kept concise and focused on critical areas.

**/*: - Feedback will only be given on issues that could cause bugs or involve very bad practices.

  • Comments will be kept concise and focused on critical areas.
  • helm-charts/mend-renovate-ce/templates/ingress.yaml
  • helm-charts/mend-renovate-ee/templates/ingress.yaml

coderabbitai[bot]
coderabbitai bot previously approved these changes May 5, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes May 5, 2025
@nabeelsaabna nabeelsaabna added this pull request to the merge queue May 6, 2025
Merged via the queue into main with commit a18add1 May 6, 2025
2 of 3 checks passed
@nabeelsaabna nabeelsaabna deleted the fix/configurable_ports_tls branch May 6, 2025 12:34
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.

2 participants
0