Documentation ¶
Index ¶
- Variables
- func ClientSet(path string) *kubernetes.Clientset
- func DynamicClient(path string) dynamic.Interface
- func GetK8SResources(ctx context.Context, kubernetesClient *KubernetesClient) error
- func GetK8SResourcesProvider(ctx context.Context, kubeconfig string)
- func GetKubeConfig(kubeconfigPath string) *rest.Config
- type K8SResource
- type KubernetesClient
- type RegoRulesList
- type ResourceProvider
- type ResultReceiver
- type ReturnMsg
- type ValidateResult
- type ValidateResults
- type Workload
Constants ¶
This section is empty.
Variables ¶
View Source
var K8sResourcesChan = make(chan K8SResource)
View Source
var KubeConfig *rest.Config
View Source
var RegoRulesListChan = make(chan RegoRulesList)
View Source
var ResultChan = make(chan ValidateResult)
View Source
var ValidateResultsChan = make(chan ValidateResults)
Functions ¶
func DynamicClient ¶
DynamicClient return dynamicClient
func GetK8SResources ¶
func GetK8SResources(ctx context.Context, kubernetesClient *KubernetesClient) error
GetK8SResources get kubernetes resources by GroupVersionResource, put the resources into the channel K8sResourcesChan, return error.
func GetK8SResourcesProvider ¶
GetK8SResourcesProvider get kubeconfig by KubernetesAPI, get kubernetes resources by GetK8SResources.
func GetKubeConfig ¶
GetKubeConfig get the kubeconfig from path or by GetConfig
Types ¶
type K8SResource ¶
type K8SResource struct { ServerVersion string CreationTime time.Time AuditAddress string Nodes []unstructured.Unstructured Namespaces []unstructured.Unstructured Deployments []unstructured.Unstructured DaemonSets []unstructured.Unstructured StatefulSets []unstructured.Unstructured Jobs []unstructured.Unstructured CronJobs []unstructured.Unstructured Roles []unstructured.Unstructured ClusterRoles []unstructured.Unstructured Events []unstructured.Unstructured }
type KubernetesClient ¶
type KubernetesClient struct { ClientSet kubernetes.Interface DynamicClient dynamic.Interface // contains filtered or unexported fields }
func KubernetesAPI ¶
func KubernetesAPI(kubeconfigPath string) *KubernetesClient
KubernetesAPI return kubeconfig clientset and dynamicClient.
type RegoRulesList ¶
type RegoRulesList struct {
RegoRules []string
}
type ResourceProvider ¶
type ResultReceiver ¶
type ValidateResult ¶
type ValidateResults ¶
type ValidateResults struct {
ValidateResults []ResultReceiver
}
Click to show internal directories.
Click to hide internal directories.