-
Notifications
You must be signed in to change notification settings - Fork 128
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
utils/types.go
Outdated
client, err := konnect.NewClient(httpClient, konnect.ClientOpts{ | ||
BaseURL: address, | ||
}) | ||
}, headers) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
konnect/client.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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.
Enabling header flags for konnect commands