Skip to content
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

tests: fix feature gates used in TestDeployAllInOneDBLESSGateway #5832

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Apr 8, 2024

What this PR does / why we need it:

TestDeployAllInOneDBLESSGateway performs an update and sets KIC's feature gates to testenv.GetFeatureGates() which by default include the KongServiceFacade=true

// user takes further action.
DefaultFeatureGates = "GatewayAlpha=true,KongServiceFacade=true"
.

This is problematic because KongServiceFacade CRD is not installed by default and the controller which watches it doesn't have a fallback mechanism and just fails to start when the aforementioned CRD is missing

if r.KongServiceFacadeEnabled {
if err := mgr.GetCache().IndexField(
context.Background(),
&incubatorv1alpha1.KongServiceFacade{},
upstreamPolicyIndexKey,
indexServiceFacadesOnUpstreamPolicyAnnotation,
); err != nil {
return fmt.Errorf("failed to index KongServiceFacades on annotation %s: %w", kongv1beta1.KongUpstreamPolicyAnnotationKey, err)
}
}

This results in

2024-04-08T14:42:33.009629453Z stderr F Error: unable to create controller "*configuration.KongUpstreamPolicyReconciler": failed to index KongServiceFacades on annotation konghq.com/upstream-policy: no matches for kind "KongServiceFacade" in version "incubator.ingress-controller.konghq.com/v1alpha1"

This PR fixes that by setting the feature gates in the test to only enable the Gateway API alpha features.

@pmalek pmalek self-assigned this Apr 8, 2024
@pmalek pmalek added the ci/run-e2e Trigger e2e test run from PR label Apr 8, 2024
@team-k8s-bot
Copy link
Collaborator

E2E (targeted) tests with KIND-based clusters were started at https://github.com/Kong/kubernetes-ingress-controller/actions/runs/8603061554

@team-k8s-bot team-k8s-bot removed the ci/run-e2e Trigger e2e test run from PR label Apr 8, 2024
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.9%. Comparing base (6038c87) to head (6f0dbc5).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5832     +/-   ##
=======================================
+ Coverage   73.2%   73.9%   +0.6%     
=======================================
  Files        176     176             
  Lines      18194   18194             
=======================================
+ Hits       13332   13458    +126     
+ Misses      3882    3735    -147     
- Partials     980    1001     +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pmalek pmalek marked this pull request as ready for review April 8, 2024 16:17
@pmalek pmalek requested a review from a team as a code owner April 8, 2024 16:17
@pmalek
Copy link
Member Author

pmalek commented Apr 8, 2024

This seems to fix the issue.

The 2 failures in https://github.com/Kong/kubernetes-ingress-controller/actions/runs/8603061554/attempts/1 come from #5828

@pmalek pmalek enabled auto-merge (squash) April 8, 2024 16:18
@pmalek pmalek merged commit 5701912 into main Apr 8, 2024
194 checks passed
@pmalek pmalek deleted the fix-TestDeployAllInOneDBLESSGateway-feature-gates branch April 8, 2024 16:20
team-k8s-bot pushed a commit that referenced this pull request Apr 8, 2024
pmalek added a commit that referenced this pull request Apr 8, 2024
…) (#5833)

(cherry picked from commit 5701912)

Co-authored-by: Patryk Małek <patryk.malek@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants