validatingwebhook

package
v1.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertificate

func CreateCertificate(certsFolder, certFileName, privKeyFileName string) (string, string, error)

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

func GenerateCertificates(certFilePath, privateKeyPath string) error

GenerateCertificates generates tls certificate files with the path specified

func GetIP

func GetIP() (net.IP, error)

GetIP finds preferred outbound ip of the machine

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL