Documentation ¶
Index ¶
- Variables
- func GetK8SResources(ctx context.Context, kubernetesClient *KubernetesClient)
- func GetK8SResourcesProvider(ctx context.Context, kubernetesClient *KubernetesClient) error
- func GetKubeConfig(kubeconfigPath string) (*rest.Config, error)
- func GetObjectCounts(ctx context.Context, kubernetesClient *KubernetesClient, resource string, ...) (*unstructured.UnstructuredList, int, error)
- type Certificate
- type K8SResource
- type KubernetesClient
- type RegoRulesList
- type ResourceProvider
- type ReturnMsg
- type ValidateResult
- type Workload
Constants ¶
This section is empty.
Variables ¶
View Source
var K8sResourcesChan = make(chan K8SResource)
View Source
var RegoRulesListChan = make(chan RegoRulesList)
View Source
var ResultChan = make(chan ValidateResult)
Functions ¶
func GetK8SResources ¶
func GetK8SResources(ctx context.Context, kubernetesClient *KubernetesClient)
GetK8SResources get kubernetes resources by GroupVersionResource, put the resources into the channel K8sResourcesChan, return error.
func GetK8SResourcesProvider ¶
func GetK8SResourcesProvider(ctx context.Context, kubernetesClient *KubernetesClient) error
GetK8SResourcesProvider get kubeconfig by KubernetesAPI, get kubernetes resources by GetK8SResources.
func GetKubeConfig ¶
GetKubeConfig get the kubeconfig from path or by GetConfig
func GetObjectCounts ¶ added in v0.4.1
func GetObjectCounts(ctx context.Context, kubernetesClient *KubernetesClient, resource string, group string) (*unstructured.UnstructuredList, int, error)
GetObjectCounts get kubernetes resources by GroupVersion
Types ¶
type Certificate ¶
type K8SResource ¶
type K8SResource struct { ServerVersion string CreationTime time.Time APIServerAddress string Nodes *unstructured.UnstructuredList NodesCount int Namespaces *unstructured.UnstructuredList NameSpacesCount int NameSpacesList []string Deployments *unstructured.UnstructuredList DaemonSets *unstructured.UnstructuredList StatefulSets *unstructured.UnstructuredList Jobs *unstructured.UnstructuredList CronJobs *unstructured.UnstructuredList WorkloadsCount int Roles *unstructured.UnstructuredList ClusterRoles *unstructured.UnstructuredList Events *unstructured.UnstructuredList }
type KubernetesClient ¶
type KubernetesClient struct { KubeConfig *rest.Config ClientSet kubernetes.Interface DynamicClient dynamic.Interface }
func (*KubernetesClient) K8SClients ¶ added in v0.4.0
func (k *KubernetesClient) K8SClients(kubeConfig *rest.Config) (*KubernetesClient, error)
K8SClients return kubeconfig clientset and dynamicClient.
type RegoRulesList ¶
type RegoRulesList struct {
RegoRules []string
}
type ResourceProvider ¶
type ValidateResult ¶
Click to show internal directories.
Click to hide internal directories.