Skip to content

Conversation

@cgpoh
Copy link

@cgpoh cgpoh commented Aug 28, 2025

Fix for 3472

Copilot AI review requested due to automatic review settings August 28, 2025 13:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds TLS configuration support to ingress resources in the Apicurio Registry operator. The implementation allows configuring multiple TLS secrets with their associated hosts through a new tlsSecrets field.

  • Adds a new tlsSecrets field to the IngressSpec class for mapping secrets to hosts
  • Implements TLS configuration in both app and UI ingress resources
  • Provides comprehensive test coverage for the new TLS functionality

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
IngressSpec.java Adds new tlsSecrets field with proper JSON annotations and documentation
ingress-tls.apicurioregistry3.yaml Example configuration demonstrating TLS setup for both app and UI ingresses
IngressITTest.java Comprehensive integration tests covering TLS configuration and updates
IngressUtils.java Utility method to convert TLS configuration to Kubernetes IngressTLS objects
UIIngressResource.java Integrates TLS configuration into UI ingress resource creation
AppIngressResource.java Integrates TLS configuration into app ingress resource creation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 99 to 106
* If tlsSecrets is specified, it takes precedence over both secretName and tlsHosts.
*/
@JsonProperty("tlsSecrets")
@JsonPropertyDescription("""
Configure TLS configuration with secret-to-hosts mapping. \
This allows multiple hosts to share the same TLS secret. \
Format: { "secret-name": ["host1", "host2"], "another-secret": ["host3"] } \
If tlsSecrets is specified, it takes precedence over both secretName and tlsHosts.""")
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

The comment mentions precedence over 'secretName' and 'tlsHosts' fields, but these fields are not visible in the current diff. If these are existing fields in the class, the documentation should clarify the interaction between these fields and the new tlsSecrets field.

Suggested change
* If tlsSecrets is specified, it takes precedence over both secretName and tlsHosts.
*/
@JsonProperty("tlsSecrets")
@JsonPropertyDescription("""
Configure TLS configuration with secret-to-hosts mapping. \
This allows multiple hosts to share the same TLS secret. \
Format: { "secret-name": ["host1", "host2"], "another-secret": ["host3"] } \
If tlsSecrets is specified, it takes precedence over both secretName and tlsHosts.""")
* If tlsSecrets is specified, it will be used for TLS configuration.
*/
@JsonProperty("tlsSecrets")
@JsonPropertyDescription("""
Configure TLS configuration with secret-to-hosts mapping. \
This allows multiple hosts to share the same TLS secret. \
Format: { "secret-name": ["host1", "host2"], "another-secret": ["host3"] } \
If tlsSecrets is specified, it will be used for TLS configuration.""")

Copilot uses AI. Check for mistakes.
Comment on lines 90 to 92
.map(AppSpec::getIngress).map(IngressSpec::getTlsSecrets).orElseGet(null);
case COMPONENT_UI -> ofNullable(primary.getSpec()).map(ApicurioRegistry3Spec::getUi)
.map(UiSpec::getIngress).map(IngressSpec::getTlsSecrets).orElseGet(null);
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

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

Using .orElseGet(null) is unnecessary since orElse(null) or simply chaining without .orElse*() would achieve the same result. The lambda () -> null is redundant here.

Suggested change
.map(AppSpec::getIngress).map(IngressSpec::getTlsSecrets).orElseGet(null);
case COMPONENT_UI -> ofNullable(primary.getSpec()).map(ApicurioRegistry3Spec::getUi)
.map(UiSpec::getIngress).map(IngressSpec::getTlsSecrets).orElseGet(null);
.map(AppSpec::getIngress).map(IngressSpec::getTlsSecrets).orElse(null);
case COMPONENT_UI -> ofNullable(primary.getSpec()).map(ApicurioRegistry3Spec::getUi)
.map(UiSpec::getIngress).map(IngressSpec::getTlsSecrets).orElse(null);

Copilot uses AI. Check for mistakes.
@jsenko
Copy link
Member

jsenko commented Sep 24, 2025

hi @cgpoh apologies for leaving your PR open for a long time. I have other work at the moment, but will focus on this when possible.

@cgpoh
Copy link
Author

cgpoh commented Sep 24, 2025

hi @cgpoh apologies for leaving your PR open for a long time. I have other work at the moment, but will focus on this when possible.

No worries! Thanks @jsenko

cgpoh and others added 2 commits September 25, 2025 09:43
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