Documentation ¶
Overview ¶
Index ¶
- Constants
- Variables
- func CheckDeploymentCleanedUp(ctx context.Context, t *testing.T, client klient.Client)
- func CheckImageRemoved(ctx context.Context, t *testing.T, nodes []string, images ...string)
- func CheckImagesExist(ctx context.Context, t *testing.T, nodes []string, images ...string)
- func ContainerNotPresentOnNode(nodeName, containerName string) func() (bool, error)
- func CreateExclusionList(namespace string, list string) env.Func
- func DeleteImageListsAndJobs(kubeConfig string) error
- func DeleteStringFromSlice(strings []string, s string) []string
- func DeployEraserConfig(kubeConfig, namespace, resourcePath, fileName string) error
- func DeployEraserHelm(namespace string, args ...string) env.Func
- func DeployEraserManifest(namespace, fileName string) env.Func
- func DeployOtelCollector(namespace string) env.Func
- func DockerPullImage(image string) (string, error)
- func DockerTagImage(image, tag string) (string, error)
- func GetClusterNodes(t *testing.T) []string
- func GetImageJob(ctx context.Context, cfg *envconf.Config) (eraserv1alpha1.ImageJob, error)
- func GetManagerLogs(ctx context.Context, cfg *envconf.Config, t *testing.T) error
- func GetPodLogs(ctx context.Context, cfg *envconf.Config, t *testing.T, imagelistTest bool) error
- func Helm(args []string) (string, error)
- func HelmInstall(kubeconfigPath, namespace string, args []string) error
- func HelmUninstall(kubeconfigPath, namespace string, args []string) error
- func ImagejobNotInCluster(kubeconfigPath string) func() (bool, error)
- func IsNotFound(err error) bool
- func KindLoadImage(clusterName string, images ...string) (string, error)
- func Kubectl(args []string) (string, error)
- func KubectlApply(kubeconfigPath, namespace string, args []string) error
- func KubectlBackground(args []string) error
- func KubectlCurlPod(kubeconfigPath, namespace string) (string, error)
- func KubectlDelete(kubeconfigPath, namespace string, args []string) error
- func KubectlDescribe(kubeconfigPath, podName, namespace string) (string, error)
- func KubectlExecCurl(kubeconfigPath, podName string, endpoint, namespace string) (string, error)
- func KubectlGet(kubeconfigPath string, otherArgs ...string) (string, error)
- func KubectlLogs(kubeconfigPath, podName, containerName, namespace string, extraArgs ...string) (string, error)
- func KubectlWait(kubeconfigPath, podName, namespace string) (string, error)
- func ListNodeContainers(nodeName string) (string, error)
- func ListNodeImages(nodeName string) (string, error)
- func MakeDeploy(env map[string]string) env.Func
- func NewDeployment(namespace, name string, replicas int32, labels map[string]string, ...) *appsv1.Deployment
- func NewPod(namespace, image, name, nodeName string) *corev1.Pod
- func NumPodsPresentForLabel(ctx context.Context, client klient.Client, num int, label string) func() (bool, error)
- type HelmPath
- type HelmSet
- type Images
- type RepoTag
Constants ¶
View Source
const ( KindClusterName = "eraser-e2e-test" ProviderResource = "eraser.yaml" Alpine = "alpine" Nginx = "nginx" NginxLatest = "docker.io/library/nginx:latest" NginxAliasOne = "docker.io/library/nginx:one" NginxAliasTwo = "docker.io/library/nginx:two" Redis = "redis" Caddy = "caddy" Prune = "imagelist" ImagePullSecret = "testsecret" FilterNodeName = "eraser-e2e-test-worker" FilterNodeSelector = "kubernetes.io/hostname=eraser-e2e-test-worker" FilterLabelKey = "eraser.sh/cleanup.filter" FilterLabelValue = "true" ScannerImageRepo = HelmPath("scanner.image.repository") ScannerImageTag = HelmPath("scanner.image.tag") CollectorImageRepo = HelmPath("collector.image.repository") CollectorImageTag = HelmPath("collector.image.tag") ManagerImageRepo = HelmPath("controllerManager.image.repository") ManagerImageTag = HelmPath("controllerManager.image.tag") EraserImageRepo = HelmPath("eraser.image.repository") EraserImageTag = HelmPath("eraser.image.tag") ImagePullSecrets = HelmPath("imagePullSecrets") )
Variables ¶
View Source
var ( Testenv env.Environment Image = os.Getenv("IMAGE") ManagerImage = os.Getenv("MANAGER_IMAGE") CollectorImage = os.Getenv("COLLECTOR_IMAGE") ScannerImage = os.Getenv("SCANNER_IMAGE") VulnerableImage = os.Getenv("VULNERABLE_IMAGE") NonVulnerableImage = os.Getenv("NON_VULNERABLE_IMAGE") NodeVersion = os.Getenv("NODE_VERSION") TestNamespace = envconf.RandomName("test-ns", 16) EraserNamespace = pkgUtil.GetNamespace() TestLogDir = os.Getenv("TEST_LOGDIR") ParsedImages *Images Timeout = time.Minute * 5 ImagePullSecretJSON = fmt.Sprintf(`[{"name":"%s"}]`, ImagePullSecret) ManagerAdditionalArgs = HelmSet{ // contains filtered or unexported fields } )
Functions ¶
func CheckDeploymentCleanedUp ¶ added in v0.5.0
func CheckImageRemoved ¶
func CheckImagesExist ¶
func CreateExclusionList ¶ added in v0.3.0
func DeleteImageListsAndJobs ¶
func DeleteStringFromSlice ¶
func DeployEraserConfig ¶
deploy eraser config.
func DeployEraserHelm ¶ added in v0.5.0
func DeployEraserManifest ¶ added in v0.3.0
func DeployOtelCollector ¶ added in v1.0.0
func DockerPullImage ¶
func DockerTagImage ¶
func GetClusterNodes ¶
This lists nodes in the cluster, filtering out the control-plane.
func GetImageJob ¶ added in v0.5.0
func GetManagerLogs ¶ added in v0.5.0
func GetPodLogs ¶ added in v0.5.0
func HelmInstall ¶
HelmInstall executes "helm install" given a list of arguments.
func HelmUninstall ¶
HelmUninstall executes "helm uninstall" given a list of arguments.
func ImagejobNotInCluster ¶
func IsNotFound ¶
func KubectlApply ¶
KubectlApply executes "kubectl apply" given a list of arguments.
func KubectlBackground ¶ added in v1.0.0
func KubectlCurlPod ¶ added in v1.0.0
KubectlDescribe executes "kubectl describe" given a list of arguments.
func KubectlDelete ¶
KubectlDelete executes "kubectl delete" given a list of arguments.
func KubectlDescribe ¶
KubectlDescribe executes "kubectl describe" given a list of arguments.
func KubectlExecCurl ¶ added in v1.0.0
func KubectlGet ¶
KubectlGet executes "kubectl get" given a list of arguments.
func KubectlLogs ¶
func KubectlLogs(kubeconfigPath, podName, containerName, namespace string, extraArgs ...string) (string, error)
KubectlLogs executes "kubectl logs" given a list of arguments.
func KubectlWait ¶ added in v1.0.0
func ListNodeContainers ¶
func ListNodeImages ¶
func NewDeployment ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.