Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BCRbenchmark = &benchmark.Benchmark{ Run: func(tenant, tenantNamespace string, kclient, tclient *kubernetes.Clientset) (bool, error) { resources := []util.GroupResource{} lists, err := kclient.Discovery().ServerPreferredResources() if err != nil { return false, err } for _, list := range lists { if len(list.APIResources) == 0 { continue } gv, err := schema.ParseGroupVersion(list.GroupVersion) if err != nil { continue } for _, resource := range list.APIResources { if len(resource.Verbs) == 0 { continue } if resource.Namespaced { continue } resources = append(resources, util.GroupResource{ APIGroup: gv.Group, APIResource: resource, }) } } for _, resource := range resources { for _, verb := range verbs { access, msg, err := util.RunAccessCheck(tclient, tenantNamespace, resource, verb) if err != nil { return false, err } if access { return false, fmt.Errorf(msg) } } } return true, nil }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.