diff --git a/resourcehandler/fieldselector.go b/resourcehandler/fieldselector.go index cfb2efa3..fec72d4e 100644 --- a/resourcehandler/fieldselector.go +++ b/resourcehandler/fieldselector.go @@ -5,7 +5,6 @@ import ( "strings" "github.com/armosec/k8s-interface/k8sinterface" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) @@ -55,22 +54,8 @@ func getNamespacesSelector(resource *schema.GroupVersionResource, ns, operator s } namespacesSlice := strings.Split(ns, ",") for _, n := range namespacesSlice { - fieldSelectors += fmt.Sprintf("%s!=%s,", fieldSelector, n) + fieldSelectors += fmt.Sprintf("%s%s%s,", fieldSelector, operator, n) } return fieldSelectors } -func setFieldSelector(listOptions *metav1.ListOptions, resource *schema.GroupVersionResource, excludedNamespaces string) { - fieldSelector := "metadata." - if resource.Resource == "namespaces" { - fieldSelector += "name" - } else if k8sinterface.IsNamespaceScope(resource.Group, resource.Resource) { - fieldSelector += "namespace" - } else { - return - } - excludedNamespacesSlice := strings.Split(excludedNamespaces, ",") - for _, excludedNamespace := range excludedNamespacesSlice { - listOptions.FieldSelector += fmt.Sprintf("%s!=%s,", fieldSelector, excludedNamespace) - } -} diff --git a/smoke_testing/init.py b/smoke_testing/init.py index ba29b9b3..573212c3 100644 --- a/smoke_testing/init.py +++ b/smoke_testing/init.py @@ -33,10 +33,15 @@ if __name__ == "__main__": run(kubescape_exec=smoke_utils.get_exec_from_args(sys.argv)) ''' -Tests to add: -1. Scan E2E -2. Download and add --use-from +Supported tests: +1. Commands +2. Version number +3. E2E yaml scanning -3. Test formats + output -4. Test -t +TODO: +1. Test formats + output +2. Test --fail-threshold +3. Test known supported FW +4. Test FW list +5. Test Controls list ''' \ No newline at end of file