-
Notifications
You must be signed in to change notification settings - Fork 819
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
Refactor and Improve Code for Kubescape Version Compatibility Check #1494
Refactor and Improve Code for Kubescape Version Compatibility Check #1494
Conversation
…eUntilKubescapeVersion Signed-off-by: cbrom <kb.cbrom@gmail.com>
Signed-off-by: cbrom <kb.cbrom@gmail.com>
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.
much more readable, thanks!
/review |
/describe |
PR Analysis
PR Feedback
How to useInstructions
|
PR Type:
Refactoring
PR Description:
This PR includes the following changes:
isRuleKubescapeVersionCompatible
function incore/cautils/datastructuresmethods.go
to use type switch for better readability and error handling.core/cautils/versioncheck_test.go
that was running twice with the same parameters.PR Main Files Walkthrough:
files:
core/cautils/datastructuresmethods.go
: Refactored theisRuleKubescapeVersionCompatible
function to use type switch for handling theuseFromKubescapeVersion
anduseUntilKubescapeVersion
attributes. This improves readability and provides better error handling when these attributes are not strings.core/cautils/versioncheck_test.go
: Fixed a test case that was running twice with the same parameters. Now, the test case runs with different parameters as intended.