-
Notifications
You must be signed in to change notification settings - Fork 85
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: probe command #468
base: main
Are you sure you want to change the base?
fix: probe command #468
Conversation
@daemon1024 @DelusionalOptimist @Prateeknandle please review :) |
Signed-off-by: mrrishi <[email protected]> Signed-off-by: jokestax <[email protected]>
Signed-off-by: mrrishi <[email protected]> Signed-off-by: jokestax <[email protected]>
Signed-off-by: Rishikesh <[email protected]> Signed-off-by: jokestax <[email protected]>
Signed-off-by: Aryan-sharma11 <[email protected]> Signed-off-by: jokestax <[email protected]>
Signed-off-by: Prateek <[email protected]> Signed-off-by: jokestax <[email protected]>
Signed-off-by: Aryan-sharma11 <[email protected]> Signed-off-by: jokestax <[email protected]>
Signed-off-by: jokestax <[email protected]>
Signed-off-by: mrrishi <[email protected]> Signed-off-by: jokestax <[email protected]>
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 squash the commits as well.
} | ||
return false | ||
} | ||
|
||
func sliceToSet(mySlice []string) mapset.Set[string] { | ||
mySet := mapset.NewSet[string]() | ||
for _, ele := range mySlice { | ||
if len(ele) >= 10 && ele[0:9] == "namespace" { |
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.
why do we need this check?
/* | ||
{ | ||
"policy_name": map[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.
kindly remove this.
Description
Previously, the
probe
command did not consider namespaces when listing policies. This oversight caused policies to be appended across all namespaces with matching labels, leading to wrong display of information.To address this, I updated the
getPoliciesOnAnnotatedPods
function. It now returns both the list of policies and their corresponding namespaces. This allows us to ensure that policies are appended only when pods are in the same namespace and have the same labels.and also formatted the code using gofumpt 😊
Fixes
Testing
go run . probe