-
Notifications
You must be signed in to change notification settings - Fork 0
ROX-31475: Add StackRox client #5
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
base: mtodor/ROX-31475-add-mcp-server
Are you sure you want to change the base?
ROX-31475: Add StackRox client #5
Conversation
df41746 to
79b040c
Compare
79b040c to
0f4dbd3
Compare
| allToolsets := getToolsets(&config.Config{}, &client.Client{}) | ||
|
|
||
| allToolsets := getToolsets(cfg) | ||
| toolsetNames := make(map[string]bool) |
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.
nit: this boolean has no meaning we are only interested in keys
| toolsetNames := make(map[string]bool) | |
| toolsetNames := make(map[string]struct{}) |
since we have a dependency on stackrox we could use stringset
or since it's just a test a slice will be enough
|
|
||
| require.NoError(t, err, "Should be able to establish HTTP connection to server") | ||
|
|
||
| _ = resp.Body.Close() |
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.
| _ = resp.Body.Close() | |
| require.NoError(t, resp.Body.Close()) |
| c.mu.Lock() | ||
| defer c.mu.Unlock() | ||
|
|
||
| if !c.shouldRedialLocked() { |
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.
It's a personal preference but I think NoLock is more common:
https://github.com/search?q=repo%3Astackrox%2Fstackrox+Locked%28&type=code
https://github.com/search?q=repo%3Astackrox%2Fstackrox+NoLock%28&type=code
This pull request is adding StackRox Client.
It's adding the following functionalities:
insecureoption is renamed toinsecure_skip_tls_verifyto be more understandable and similar to other toolsFile:
internal/toolsets/config/tools.go- Besides that it also adds an example implementation oflist_clusterstool. Purpose of that is to simply test the full flow. Proper implementation oflist_clusterstool will be done in a followup PR.