-
Notifications
You must be signed in to change notification settings - Fork 5
CLI: Update Go SDK to 13b9433ac69ebc50e5c60ecd48c64b10e5681d01 #119
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aedbbe5
Update Go SDK to a55939677e57dff0ffe833e8961e47a1a1bbce71
kernel-internal[bot] ba1a9b6
Merge main into cli-coverage-update
kernel-internal[bot] 815ff8f
Update Go SDK to da97422ae11843be81340c909b4a138f6ce252b2
kernel-internal[bot] 201940f
Merge main into cli-coverage-update
kernel-internal[bot] d7009b5
Update Go SDK to v0.39.0
kernel-internal[bot] ce7f998
Add SDK 0.39 proxy support
sjmiller609 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package proxies | ||
|
|
||
| import ( | ||
| "context" | ||
| "testing" | ||
|
|
||
| "github.com/kernel/kernel-go-sdk" | ||
| "github.com/kernel/kernel-go-sdk/option" | ||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| func TestProxyCheck_ShowsBypassHosts(t *testing.T) { | ||
| buf := captureOutput(t) | ||
|
|
||
| fake := &FakeProxyService{ | ||
| CheckFunc: func(ctx context.Context, id string, opts ...option.RequestOption) (*kernel.ProxyCheckResponse, error) { | ||
| return &kernel.ProxyCheckResponse{ | ||
| ID: id, | ||
| Name: "Proxy 1", | ||
| Type: kernel.ProxyCheckResponseTypeDatacenter, | ||
| BypassHosts: []string{"localhost", "internal.service.local"}, | ||
| Status: kernel.ProxyCheckResponseStatusAvailable, | ||
| }, nil | ||
| }, | ||
| } | ||
|
|
||
| p := ProxyCmd{proxies: fake} | ||
| err := p.Check(context.Background(), ProxyCheckInput{ID: "proxy-1"}) | ||
|
|
||
| assert.NoError(t, err) | ||
| output := buf.String() | ||
| assert.Contains(t, output, "Bypass Hosts") | ||
| assert.Contains(t, output, "localhost") | ||
| assert.Contains(t, output, "internal.service.local") | ||
| assert.Contains(t, output, "Proxy health check passed") | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package proxies | ||
|
|
||
| import "strings" | ||
|
|
||
| func formatBypassHosts(hosts []string) string { | ||
| if len(hosts) == 0 { | ||
| return "-" | ||
| } | ||
|
|
||
| return strings.Join(hosts, ", ") | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Normalization may send unintended empty array to API
Low Severity
When
in.BypassHostscontains only whitespace or empty strings (e.g.,--bypass-host " "), the guardlen(in.BypassHosts) > 0passes, butnormalizeBypassHostsfilters everything out and returns an empty[]string{}. This empty (non-nil) slice gets assigned toparams.BypassHosts, which serializes as"bypass_hosts":[]in JSON rather than omitting the field entirely. The API may treat an explicit empty array differently from an absent field.