Skip to content

Commit

Permalink
e2e: remove Simple workload and test
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Apr 26, 2024
1 parent aeb5873 commit e2acced
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 126 deletions.
68 changes: 0 additions & 68 deletions .github/workflows/e2e_simple.yml

This file was deleted.

2 changes: 0 additions & 2 deletions e2e/internal/kuberesource/resourcegen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ func main() {
resources, err = kuberesource.CoordinatorRelease()
case "runtime":
resources, err = kuberesource.Runtime()
case "simple":
resources, err = kuberesource.Simple()
case "openssl":
resources, err = kuberesource.OpenSSL()
case "emojivoto":
Expand Down
50 changes: 0 additions & 50 deletions e2e/internal/kuberesource/sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,56 +42,6 @@ func Runtime() ([]any, error) {
return resources, nil
}

// Simple returns a simple set of resources for testing.
func Simple() ([]any, error) {
ns := "edg-default"

namespace := Namespace(ns)
coordinator := Coordinator(ns).DeploymentApplyConfiguration
coordinatorService := ServiceForDeployment(coordinator)
coordinatorForwarder := PortForwarder("coordinator", ns).
WithListenPort(1313).
WithForwardTarget("coordinator", 1313).
PodApplyConfiguration

workload := Deployment("workload", ns).
WithSpec(DeploymentSpec().
WithReplicas(1).
WithSelector(LabelSelector().
WithMatchLabels(map[string]string{"app.kubernetes.io/name": "workload"}),
).
WithTemplate(PodTemplateSpec().
WithLabels(map[string]string{"app.kubernetes.io/name": "workload"}).
WithSpec(PodSpec().
WithRuntimeClassName(runtimeHandler).
WithContainers(
Container().
WithName("workload").
WithImage("docker.io/library/busybox:1.36.1-musl@sha256:d4707523ce6e12afdbe9a3be5ad69027150a834870ca0933baf7516dd1fe0f56").
WithCommand("/bin/sh", "-c", "echo Workload started ; while true; do sleep 60; done").
WithResources(ResourceRequirements().
WithMemoryLimitAndRequest(50),
),
),
),
),
)
workload, err := AddInitializer(workload, Initializer())
if err != nil {
return nil, err
}

resources := []any{
namespace,
coordinator,
coordinatorService,
coordinatorForwarder,
workload,
}

return resources, nil
}

// OpenSSL returns a set of resources for testing with OpenSSL.
func OpenSSL() ([]any, error) {
ns := "edg-default"
Expand Down
9 changes: 3 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ initializer: (push "initializer")
node-installer: (push "node-installer")

default_cli := "contrast.cli"
default_deploy_target := "simple"
default_deploy_target := "openssl"
workspace_dir := "workspace"

# Generate policies, apply Kubernetes manifests.
Expand All @@ -49,7 +49,7 @@ populate target=default_deploy_target:
set -euo pipefail
mkdir -p ./{{ workspace_dir }}
case {{ target }} in
"simple" | "openssl" | "emojivoto")
"openssl" | "emojivoto")
nix shell .#contrast --command resourcegen {{ target }} ./{{ workspace_dir }}/deployment/deployment.yml
;;
*)
Expand Down Expand Up @@ -82,7 +82,7 @@ apply target=default_deploy_target:
kubectl apply -f ./{{ workspace_dir }}/runtime
exit 0
;;
"simple" | "openssl" | "emojivoto")
"openssl" | "emojivoto")
:
;;
*)
Expand Down Expand Up @@ -164,9 +164,6 @@ wait-for-workload target=default_deploy_target:
set -euo pipefail
ns=$(cat ./{{ workspace_dir }}/just.namespace)
case {{ target }} in
"simple")
nix run .#scripts.kubectl-wait-ready -- $ns workload
;;
"openssl")
nix run .#scripts.kubectl-wait-ready -- $ns openssl-backend
nix run .#scripts.kubectl-wait-ready -- $ns openssl-client
Expand Down

0 comments on commit e2acced

Please sign in to comment.