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:deck konnect commands do not honor --headers flag #468 #557

Merged
merged 6 commits into from
Jan 4, 2022

Conversation

rajkong
Copy link
Contributor

@rajkong rajkong commented Jan 3, 2022

Enabling header flags for konnect commands

@rajkong rajkong requested a review from a team as a code owner January 3, 2022 21:40
@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2022

Codecov Report

Merging #557 (8d30706) into main (a7256c2) will decrease coverage by 0.08%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #557      +/-   ##
==========================================
- Coverage   51.96%   51.88%   -0.09%     
==========================================
  Files          73       73              
  Lines        7730     7742      +12     
==========================================
  Hits         4017     4017              
- Misses       3363     3375      +12     
  Partials      350      350              
Impacted Files Coverage Δ
cmd/root.go 55.49% <0.00%> (-0.30%) ⬇️
utils/types.go 21.55% <0.00%> (-2.26%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7256c2...8d30706. Read the comment docs.

utils/types.go Outdated
client, err := konnect.NewClient(httpClient, konnect.ClientOpts{
BaseURL: address,
})
}, headers)
Copy link
Member

Choose a reason for hiding this comment

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

Let's make changes only in this file and bring changes that are in konnect/client.go into this file.
This way we can keep the "client with header" logic within this file and re-use it across the Kong and Konnect clients.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@@ -41,7 +41,7 @@ type ClientOpts struct {
// NewClient returns a Client which talks to Konnect's API.
func NewClient(httpClient *http.Client, opts ClientOpts) (*Client, error) {
if httpClient == nil {
httpClient = http.DefaultClient
return nil, fmt.Errorf("nil httpClient passed")
Copy link
Member

@hbagdi hbagdi Jan 4, 2022

Choose a reason for hiding this comment

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

Please revert this since this change is unrelated.

@hbagdi hbagdi merged commit 6cf2b01 into Kong:main Jan 4, 2022
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.

3 participants