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: fill config defaults #309

Merged
merged 15 commits into from
Apr 7, 2023
Merged

Conversation

nishant95
Copy link
Contributor

This has the fix applied in #302 along with resolution for #307

Added test for the bug encountered in #307 as well.

kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2023

Codecov Report

Patch coverage: 96.29% and project coverage change: -15.17 ⚠️

Comparison is base (3ec599f) 52.85% compared to head (55f775b) 37.68%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #309       +/-   ##
===========================================
- Coverage   52.85%   37.68%   -15.17%     
===========================================
  Files          66       68        +2     
  Lines        4885     5012      +127     
===========================================
- Hits         2582     1889      -693     
- Misses       1742     2790     +1048     
+ Partials      561      333      -228     
Flag Coverage Δ
2.1.4 35.87% <96.29%> (+1.09%) ⬆️
2.2.1.3 ?
2.2.2 35.87% <96.29%> (+1.09%) ⬆️
2.3.3 36.03% <96.29%> (-0.39%) ⬇️
2.3.3.4 ?
2.4.1 36.11% <96.29%> (-0.39%) ⬇️
2.4.1.3 ?
2.5.1.2 ?
2.5.2 36.11% <96.29%> (-0.39%) ⬇️
2.6.1 36.11% <96.29%> (-0.39%) ⬇️
2.6.1.0 ?
2.7.2 36.11% <96.29%> (-0.39%) ⬇️
2.7.2.0 ?
2.8.3 36.11% <96.29%> (-0.39%) ⬇️
2.8.4.0 ?
3.0.2 35.55% <96.29%> (-0.38%) ⬇️
3.0.2.0 ?
3.1.1 37.07% <96.29%> (-0.42%) ⬇️
3.1.1.3 ?
3.2.2 37.13% <96.29%> (-0.42%) ⬇️
3.2.2.1 ?
community 37.68% <96.29%> (-0.43%) ⬇️
enterprise ?
enterprise-nightly ?
integration 37.68% <96.29%> (-15.17%) ⬇️
nightly 37.13% <96.29%> (-0.42%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
kong/utils.go 86.82% <96.29%> (-0.19%) ⬇️

... and 22 files with indirect coverage changes

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 in Codecov by Sentry.
📢 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.

Thanks! 👍 Some minor nits.

I'll let @rainest double check when he comes online but looks good to me.

kong/utils_test.go Outdated Show resolved Hide resolved
kong/utils_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@rainest rainest left a comment

Choose a reason for hiding this comment

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

Kong/kubernetes-ingress-controller#3866 trial run integrated into KIC is passing Knative and conformance now, so extra confirmation in integration that the Request Transformer configuration is no longer getting clobbered.

Kong/deck#888 now succeeds as well, where it was failing with 0.39.1

@rainest rainest merged commit 2f79c1f into Kong:main Apr 7, 2023
@nishant95
Copy link
Contributor Author

this fixes #307

@aboudreault
Copy link
Contributor

aboudreault commented Jun 2, 2023

@nishant95 @pmalek @rainest looks like this change introduced another bug where an array is completely ignored. we can reproduce with deck and the following:

_format_version: "3.0"

plugins:
- name: kafka-log
  enabled: false
  config:
    topic: konnect.auditlogs.gateway-access-logs
    bootstrap_servers:
    - host: broker-1.endpoint
      port: 9096
    - host: broker-1.endpoint
      port: 9096
    - host: broker-1.endpoint
      port: 9096
    authentication:
      strategy: sasl
      mechanism: SCRAM-SHA-512
      user: sasl_user
      password: xxxxxxxx
    security:
      ssl: false
    cluster_name: konnect-msk

with deck v1.21.0 and go-kong 0.41.0+, bootstrap_serversis set to null

@aboudreault
Copy link
Contributor

ref: #333

@nishant95
Copy link
Contributor Author

nishant95 commented Jun 5, 2023

@aboudreault #309 only adds handling for subconfig of type "array", how does this cause a subconfig of type "set" to fail?
How was this working before this PR was merged?

Also, the handle_missing_fields in lua code and FillPluginsDefaults in go-kong seems out of sync. We recently faced an issue in case of non-required subconfig of type record (Testing the fix, yet to raise a PR).
Kong kept the default as nil but KIC filled the default with a record with nil fields causing KIC to be stuck in sync retry loop and ultimately getting OOMKilled. Issue: #334

@nishant95
Copy link
Contributor Author

@pmalek @rainest @aboudreault
Fix for #334: #336

This pull request was closed.
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.

6 participants