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

feat: add Client.ReloadDeclarativeConfig() #252

Merged
merged 1 commit into from
Dec 15, 2022
Merged

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Dec 14, 2022

This PR adds possibility to send declarative configs to Kong via /config.

It also makes Client.NewRequestRaw() more "flexible" ( I guess? ) by checking the type of the accepted argument and calls json.Marshal() only when the provided argument is not string, []byte or io.Reader.


Unfortunately we cannot accept proper types as parameters because deck already imports go-kong so using e.g. KongRawState or file.Content is not possible because that would cause a circular dependency.

@pmalek pmalek added the enhancement New feature or request label Dec 14, 2022
@pmalek pmalek self-assigned this Dec 14, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2022

Codecov Report

Base: 53.31% // Head: 52.85% // Decreases project coverage by -0.45% ⚠️

Coverage data is based on head (3e8fc96) compared to base (9a0b9ec).
Patch coverage: 29.11% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #252      +/-   ##
==========================================
- Coverage   53.31%   52.85%   -0.46%     
==========================================
  Files          46       47       +1     
  Lines        4183     4255      +72     
==========================================
+ Hits         2230     2249      +19     
- Misses       1478     1525      +47     
- Partials      475      481       +6     
Flag Coverage Δ
2.1.4 39.83% <29.11%> (-0.24%) ⬇️
2.2.1.3 48.95% <29.11%> (-0.11%) ⬇️
2.2.2 39.83% <29.11%> (-0.24%) ⬇️
2.3.3 39.83% <29.11%> (-0.24%) ⬇️
2.3.3.4 48.95% <29.11%> (-0.11%) ⬇️
2.4.0 39.83% <29.11%> (-0.24%) ⬇️
2.4.1.3 48.95% <29.11%> (-0.11%) ⬇️
2.5.1 39.83% <29.11%> (-0.24%) ⬇️
2.5.1.2 48.95% <29.11%> (-0.11%) ⬇️
2.6.0 39.83% <29.11%> (-0.24%) ⬇️
2.6.0.2 48.95% <29.11%> (-0.11%) ⬇️
2.7.0 39.83% <29.11%> (-0.24%) ⬇️
2.7.0.0 48.95% <29.11%> (-0.11%) ⬇️
2.8.0 39.83% <29.11%> (-0.24%) ⬇️
2.8.2.2 48.95% <29.11%> (-0.11%) ⬇️
3.0.1 39.17% <29.11%> (-0.23%) ⬇️
3.0.1.0 49.49% <29.11%> (-0.12%) ⬇️
3.1.0 39.17% <29.11%> (-0.23%) ⬇️
3.1.0.0 49.49% <29.11%> (-0.12%) ⬇️
community 39.83% <29.11%> (-0.24%) ⬇️
enterprise 50.15% <29.11%> (-0.13%) ⬇️
integration 52.85% <29.11%> (-0.46%) ⬇️

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

Impacted Files Coverage Δ
kong/config_service.go 0.00% <0.00%> (ø)
kong/test_utils.go 47.50% <31.25%> (-5.91%) ⬇️
kong/request.go 65.71% <80.00%> (+10.15%) ⬆️
kong/client.go 60.57% <100.00%> (+0.19%) ⬆️

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.

kong/client.go Outdated Show resolved Hide resolved
kong/client.go Outdated Show resolved Hide resolved
@pmalek pmalek force-pushed the add-client-sendconfig branch 3 times, most recently from 9ae24cc to d512014 Compare December 15, 2022 12:22
@pmalek pmalek changed the title feat: add Client.SendConfig() feat: add Client.ReloadDeclarativeConfig() Dec 15, 2022
@pmalek pmalek requested a review from czeslavo December 15, 2022 12:22
@pmalek pmalek marked this pull request as ready for review December 15, 2022 12:22
@pmalek pmalek requested a review from a team as a code owner December 15, 2022 12:22
kong/config_service.go Outdated Show resolved Hide resolved
kong/config_service.go Outdated Show resolved Hide resolved
kong/config_service.go Outdated Show resolved Hide resolved
@pmalek pmalek requested a review from czeslavo December 15, 2022 14:50
@pmalek pmalek force-pushed the add-client-sendconfig branch 3 times, most recently from b98c50c to 7314713 Compare December 15, 2022 17:45
@pmalek pmalek merged commit 56eb706 into main Dec 15, 2022
@pmalek pmalek deleted the add-client-sendconfig branch December 15, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants