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

fix: only check if condition contained in ensuring gateway associated of httproute #3346

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

randmonkey
Copy link
Contributor

What this PR does / why we need it:

Now more than one conditions are added to HTTPRoute.status.parentStatus[*], so we need to change the method to check if parent status for gateways changed. Instead of making a full comparison of conditions, we check if the existing parentStatus contains the expected condtion.

Which issue this PR fixes:

fixes #3345

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@randmonkey randmonkey requested a review from a team as a code owner January 9, 2023 09:35
@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Base: 74.2% // Head: 74.2% // Increases project coverage by +0.0% 🎉

Coverage data is based on head (174b992) compared to base (e3c862d).
Patch coverage: 100.0% of modified lines in pull request are covered.

❗ Current head 174b992 differs from pull request most recent head 5a87f79. Consider uploading reports for the commit 5a87f79 to get more accurate results

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3346   +/-   ##
=====================================
  Coverage   74.2%   74.2%           
=====================================
  Files        110     110           
  Lines      13227   13233    +6     
=====================================
+ Hits        9818    9831   +13     
+ Misses      2787    2782    -5     
+ Partials     622     620    -2     
Impacted Files Coverage Δ
...ternal/controllers/gateway/httproute_controller.go 58.3% <100.0%> (+2.4%) ⬆️
internal/controllers/gateway/route_utils.go 76.5% <100.0%> (+0.2%) ⬆️
internal/dataplane/parser/parser.go 89.7% <0.0%> (-2.5%) ⬇️
internal/dataplane/kongstate/service.go 67.3% <0.0%> (+1.2%) ⬆️
...nternal/controllers/gateway/tlsroute_controller.go 75.8% <0.0%> (+2.6%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

Nice find, some nits but overall 👍

internal/controllers/gateway/httproute_controller.go Outdated Show resolved Hide resolved
internal/controllers/gateway/httproute_controller.go Outdated Show resolved Hide resolved
@randmonkey randmonkey force-pushed the fix/check_httproute_parent_status branch from 6567405 to 3c11985 Compare January 9, 2023 17:04
Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

I wonder if this shouldn't actually get its own changelog entry. Do you mind adding it @randmonkey ?

internal/controllers/gateway/route_utils.go Outdated Show resolved Hide resolved
@randmonkey randmonkey force-pushed the fix/check_httproute_parent_status branch from 3c11985 to 66c8251 Compare January 9, 2023 17:26
@randmonkey
Copy link
Contributor Author

I wonder if this shouldn't actually get its own changelog entry. Do you mind adding it @randmonkey ?

Added changelogs.

@randmonkey randmonkey force-pushed the fix/check_httproute_parent_status branch from 174b992 to 5a87f79 Compare January 9, 2023 17:39
@randmonkey randmonkey requested a review from pmalek January 9, 2023 17:45
@pmalek pmalek added this to the KIC v2.9.0 milestone Jan 9, 2023
@pmalek
Copy link
Member

pmalek commented Jan 9, 2023

Created Kong/kubernetes-testing-framework#489 to cover the failure in tests

Error: tests failed: failed to deploy addon kong: Error: INSTALLATION FAILED: Service "ingress-controller-kong-admin" is invalid: spec.ports[0].nodePort: Invalid value: 32080: provided port is already allocated

oh, what a chance

@pmalek pmalek enabled auto-merge (squash) January 9, 2023 18:59
@pmalek pmalek disabled auto-merge January 9, 2023 18:59
@pmalek pmalek enabled auto-merge (squash) January 9, 2023 18:59
@pmalek pmalek merged commit 4b16d14 into main Jan 9, 2023
@pmalek pmalek deleted the fix/check_httproute_parent_status branch January 9, 2023 19:24
@pmalek pmalek added the fix label Mar 1, 2023
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.

Duplicate update of HTTPRoute status makes code unreachable
2 participants