-
Notifications
You must be signed in to change notification settings - Fork 218
feat: add namespace setting to k8s protocol configuration #1942
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
Conversation
| return stdout.String(), nil | ||
| } | ||
|
|
||
| func shellOutOrEmpty(env []string, line string) string { |
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.
The given code seems to be an example of using Go's standard library and its packages for interacting with the Jump Server cloud platform, specifically dealing with authentication, network connections, client configuration management, etc. There doesn't seem to be anything unusual about it but there could be some general improvements that one might consider making:
- Consider adding comments explaining what you're doing instead of having long lines of code without comments.
- If
srvconndoes not contain any functionality other than providing interfaces and utility functions (initClient,GetKubeConfig,resolveNamespaces) then perhaps it's unnecessary duplication to include them here since they can be easily accessed from theproxy.KubernetesController. - Use more descriptive function names if possible to make code easier to understand at glance.
Without knowing exactly how this code is used, these are general recommendations.
I hope this helps! Let me know if you need further assistance.
| "Namespace": namespaceValue, | ||
| }), | ||
| ) | ||
| return |
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.
This code appears to be part of a server that provides access to Kubernetes clusters. The changes you have indicated are:
- Adding variable
namespaceValueto store the namespace value if it's set in K8sSettings- This may not necessarily improve efficiency but should ensure better management
To further optimize these functions, consider making the logic more efficient by caching frequently used data when accessing SSH connection objects.
If there are no issues with security or performance and this is a production-ready codebase then this might just work fine as it stands. But without reviewing its use cases or specific business requirements it can't say conclusively whether improvements need to be made here or elsewhere. Please let us know how else we could help!
| namespaceValue, | ||
| userCon.ConnectToken.Account.Secret, | ||
| userCon.ConnectToken.Gateway, | ||
| ) |
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.
There is no obvious issue with the above code snippet as it looks like you provided some sample code, which I have analyzed briefly to confirm there isn't any major problem. However, it's essential always to thoroughly review code when debugging in order to find potential issues that may occur during runtime.
In case of further discrepancies or if there are specific programming concepts you're unsure about, please let me know and assist you accordingly.
|



feat: add namespace setting to k8s protocol configuration