Documentation ¶
Index ¶
- func CreateCertificate(certsFolder, certFileName, privKeyFileName string) (string, string, error)
- func CreateDefaultKindCluster() error
- func CreateTerrascanConfigFile(configFileName, policyRootRelPath string, ...) error
- func DeleteDefaultKindCluster() error
- func GenerateCertificates(certFilePath, privateKeyPath string) error
- func GetIP() (net.IP, error)
- type KubernetesClient
- func (k *KubernetesClient) CreatePod(resourceFile string) (*v1.Pod, error)
- func (k *KubernetesClient) CreateService(resourceFile string) (*v1.Service, error)
- func (k *KubernetesClient) CreateValidatingWebhookConfiguration(webhookFile, certFile, apiKey, port string) (*admissionv1.ValidatingWebhookConfiguration, error)
- func (k *KubernetesClient) DeletePod(podName string) error
- func (k *KubernetesClient) DeleteService(serviceName string) error
- func (k *KubernetesClient) DeleteValidatingWebhookConfiguration(webhookConfigName string) error
- func (k *KubernetesClient) WaitForServiceAccount(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCertificate ¶
CreateCertificate creates certificates required to run server in the folder specified
func CreateDefaultKindCluster ¶
func CreateDefaultKindCluster() error
CreateDefaultKindCluster creates the default kind cluster
func CreateTerrascanConfigFile ¶
func CreateTerrascanConfigFile(configFileName, policyRootRelPath string, terrascanConfig *config.TerrascanConfig) error
CreateTerrascanConfigFile creates a config file with test policy path
func DeleteDefaultKindCluster ¶
func DeleteDefaultKindCluster() error
DeleteDefaultKindCluster deletes the default kind cluster
func GenerateCertificates ¶
GenerateCertificates generates tls certificate files with the path specified
Types ¶
type KubernetesClient ¶
type KubernetesClient struct {
// contains filtered or unexported fields
}
KubernetesClient will connect to local k8s cluster, and help perform resource operation
func NewKubernetesClient ¶
func NewKubernetesClient() (*KubernetesClient, error)
NewKubernetesClient creates a new Kubernetes client
func (*KubernetesClient) CreatePod ¶
func (k *KubernetesClient) CreatePod(resourceFile string) (*v1.Pod, error)
CreatePod will create a pod by parsing a resource file
func (*KubernetesClient) CreateService ¶
func (k *KubernetesClient) CreateService(resourceFile string) (*v1.Service, error)
CreateService will a service by parsing a resource file
func (*KubernetesClient) CreateValidatingWebhookConfiguration ¶
func (k *KubernetesClient) CreateValidatingWebhookConfiguration(webhookFile, certFile, apiKey, port string) (*admissionv1.ValidatingWebhookConfiguration, error)
CreateValidatingWebhookConfiguration creates a ValidatingWebhookConfiguration
func (*KubernetesClient) DeletePod ¶
func (k *KubernetesClient) DeletePod(podName string) error
DeletePod will delete the specified pod name
func (*KubernetesClient) DeleteService ¶
func (k *KubernetesClient) DeleteService(serviceName string) error
DeleteService will delete the specified service name
func (*KubernetesClient) DeleteValidatingWebhookConfiguration ¶
func (k *KubernetesClient) DeleteValidatingWebhookConfiguration(webhookConfigName string) error
DeleteValidatingWebhookConfiguration will delete the specified webhook name
func (*KubernetesClient) WaitForServiceAccount ¶
func (k *KubernetesClient) WaitForServiceAccount(ctx context.Context) error
WaitForServiceAccount will wait for the default serviceaccount to get created