Documentation ¶
Index ¶
- type Fetcher
- func (f *Fetcher) GetAuditedNamespaces() (*v1.NamespaceList, error)
- func (f *Fetcher) GetClusterAdmissionPolicies() ([]policiesv1.Policy, int, error)
- func (f *Fetcher) GetNamespace(nsName string) (*v1.Namespace, error)
- func (f *Fetcher) GetPoliciesForANamespace(namespace string) ([]policiesv1.Policy, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher fetches Kubewarden policies from the Kubernetes cluster, and filters policies that are auditable.
func NewFetcher ¶
NewFetcher returns a Fetcher. It will try to use in-cluster config, which will work just if audit-scanner is deployed inside a Pod. If in-cluster fails, it will try to fetch the kube config from the home dir. It will return an error if both attempts fail.
func (*Fetcher) GetAuditedNamespaces ¶
func (f *Fetcher) GetAuditedNamespaces() (*v1.NamespaceList, error)
GetAuditedNamespaces gets all namespaces besides the ones in fetcher.skippedNs This function cannot be tested with fake.client, as fake.client doesn't support fields.OneTermNotEqualSelector()
func (*Fetcher) GetClusterAdmissionPolicies ¶
func (f *Fetcher) GetClusterAdmissionPolicies() ([]policiesv1.Policy, int, error)
GetClusterAdmissionPolicies gets all auditable ClusterAdmissionPolicy policies, and the number of skipped policies
func (*Fetcher) GetPoliciesForANamespace ¶
GetPoliciesForANamespace gets all auditable policies for a given namespace, and the number of skipped policies