-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: support ingress translator #78
Conversation
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
There was a problem hiding this 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 introduces ingress translator support by extending the translation context with Service resources and adding logic to convert Ingress resources into corresponding ADC objects.
- Add a Services map in TranslateContext to manage Service objects.
- Implement and enhance the ingress translation including TLS handling, route generation, and endpoint slice processing.
- Update controller logic to integrate the new Service processing and adjust resource deletion and indexing.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
internal/provider/provider.go | Adds Services map to TranslateContext to support ingress translation. |
internal/provider/adc/translator/ingress.go | Implements ingress translation logic including TLS, service, and route creation. |
internal/provider/adc/translator/gateway.go | Adjusts TLS handling logic for gateway translation. |
internal/provider/adc/adc.go | Updates ADC deletion logic to include Ingress resources. |
internal/controller/ingress_controller.go | Updates controller to process Service objects and handle nil secret data. |
internal/controller/indexer/indexer.go | Minor reordering of constant definitions. |
api/adc/types.go | Modifies JSON serialization behavior for Upstream Nodes. |
Comments suppressed due to low confidence (1)
internal/provider/adc/translator/ingress.go:194
- Parameter 'servciePort' appears to be misspelled; consider renaming it to 'servicePort' for improved readability.
func (t *Translator) translateEndpointSliceForIngress(weight int, endpointSlices []discoveryv1.EndpointSlice, servciePort *corev1.ServicePort) adctypes.UpstreamNodes {
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-04-07T17:19:28Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: API7
project: api7-ingress-controller
url: https://github.com/api7/api7-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
failedTests:
- HTTPRoutePathMatchOrder
- HTTPRouteRedirectHostAndStatus
- HTTPRouteSimpleSameNamespace
result: failure
skippedTests:
- GatewayInvalidTLSConfiguration
- GatewaySecretInvalidReferenceGrant
- GatewaySecretMissingReferenceGrant
- GatewaySecretReferenceGrantAllInNamespace
- GatewaySecretReferenceGrantSpecific
- HTTPRouteExactPathMatching
- HTTPRouteHTTPSListener
- HTTPRouteHeaderMatching
- HTTPRouteHostnameIntersection
- HTTPRouteInvalidBackendRefUnknownKind
- HTTPRouteInvalidCrossNamespaceBackendRef
- HTTPRouteInvalidCrossNamespaceParentRef
- HTTPRouteInvalidNonExistentBackendRef
- HTTPRouteInvalidParentRefNotMatchingSectionName
- HTTPRouteInvalidReferenceGrant
- HTTPRouteListenerHostnameMatching
- HTTPRouteMatching
- HTTPRouteMatchingAcrossRoutes
- HTTPRoutePartiallyInvalidViaInvalidReferenceGrant
- HTTPRouteReferenceGrant
- HTTPRouteRequestHeaderModifier
- HTTPRouteWeight
statistics:
Failed: 3
Passed: 8
Skipped: 22
name: GATEWAY-HTTP
summary: Core tests failed with 3 test failures. |
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
…s_translator Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 10 out of 13 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- Makefile: Language not supported
- test/e2e/framework/manifests/cert.pem: Language not supported
- test/e2e/framework/manifests/key.pem: Language not supported
Comments suppressed due to low confidence (2)
api/adc/types.go:151
- Removing 'omitempty' from the Nodes field may cause issues when the nodes list is empty; verify that this change is intentional and that downstream consumers can handle an empty list.
Nodes UpstreamNodes `json:"nodes" yaml:"nodes"`
test/e2e/ingress/ingress.go:67
- [nitpick] Using fixed sleep durations can lead to flaky tests; consider using a polling mechanism or wait function to reliably detect when resources are ready.
time.Sleep(5 * time.Second)
Co-authored-by: Copilot <[email protected]>
…at/ingress_translator
Signed-off-by: ashing [email protected]