feat: support ingress translator#78
Merged
ronething merged 14 commits intorelease-v2-devfrom Apr 7, 2025
Merged
Conversation
Signed-off-by: ashing <axingfly@gmail.com>
Signed-off-by: ashing <axingfly@gmail.com>
Contributor
There was a problem hiding this comment.
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 {
Contributor
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. |
…s_translator Signed-off-by: ashing <axingfly@gmail.com>
AlinsRan
reviewed
Apr 7, 2025
Signed-off-by: ashing <axingfly@gmail.com>
AlinsRan
approved these changes
Apr 7, 2025
Contributor
There was a problem hiding this comment.
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 <175728472+Copilot@users.noreply.github.com>
…at/ingress_translator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: ashing axingfly@gmail.com