From 22dcaccc4948b8b4e234eed463331c9851fa507a Mon Sep 17 00:00:00 2001 From: Wanlin Du Date: Fri, 4 Feb 2022 16:02:04 -0800 Subject: [PATCH] Cleanup the PR --- api/v1/loadtest_types.go | 12 ++++++------ config/constants.go | 6 +----- config/crd/bases/e2etest.grpc.io_loadtests.yaml | 13 ++++++------- config/samples/go_example_loadtest.yaml | 4 ++-- containers/init/ready/suite_test.go | 3 ++- 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/api/v1/loadtest_types.go b/api/v1/loadtest_types.go index 66e85237..e21d4aa6 100644 --- a/api/v1/loadtest_types.go +++ b/api/v1/loadtest_types.go @@ -126,8 +126,8 @@ type Driver struct { // +optional Build *Build `json:"build,omitempty"` - // Run describes a list of run container, where the first container is the - // runtime of the driver for the actual test. + // Run describes a list of run containers. The container for the test driver is always + // the first container on the list. Run []corev1.Container `json:"run"` } @@ -178,8 +178,8 @@ type Server struct { // +optional Build *Build `json:"build,omitempty"` - // Run describes a list of run containers, which is the runtime of the server for - // the actual test. + // Run describes a list of run containers. The container for the test server is always + // the first container on the list. Run []corev1.Container `json:"run"` } @@ -232,8 +232,8 @@ type Client struct { // +optional Build *Build `json:"build,omitempty"` - // Run describes a list of run container, , which is the runtime of the client for - // the actual test. + // Run describes a list of run containers. The container for the test client is always + // the first container on the list. Run []corev1.Container `json:"run"` } diff --git a/config/constants.go b/config/constants.go index e4bfade1..c9586d62 100644 --- a/config/constants.go +++ b/config/constants.go @@ -101,7 +101,7 @@ const ( // RunContainerName holds the name of the main container where the test is // executed. The runtime for the test may contain multiple run containers. // The main container is always the first container on the list. - RunContainerName = "run" + RunContainerName = "main" // ScenariosFileEnv specifies the name of an env variable that specifies the // path to a JSON file with scenarios. @@ -123,10 +123,6 @@ const ( // the init containers and containers for a driver or worker pod. WorkspaceVolumeName = "workspace" - // WorkerContainerName holds the name of the worker container where the test is - // executed. - WorkerContainerName = "worker" - // KillAfterEnv specifies the name of the env variable that sets the allowed response time for a pod after timeout. KillAfterEnv = "KILL_AFTER" diff --git a/config/crd/bases/e2etest.grpc.io_loadtests.yaml b/config/crd/bases/e2etest.grpc.io_loadtests.yaml index 61ccea03..b1b99a7d 100644 --- a/config/crd/bases/e2etest.grpc.io_loadtests.yaml +++ b/config/crd/bases/e2etest.grpc.io_loadtests.yaml @@ -246,8 +246,8 @@ spec: will choose a pool based on defaults. type: string run: - description: Run describes a list of run container, , which - is the runtime of the client for the actual test. + description: Run describes a list of run containers. The container + for the test client is always the first container on the list. items: description: A single application container that you want to run within a pod. @@ -1579,9 +1579,8 @@ spec: choose a pool based on defaults. type: string run: - description: Run describes a list of run container, where the - first container is the runtime of the driver for the actual - test. + description: Run describes a list of run containers. The container + for the test driver is always the first container on the list. items: description: A single application container that you want to run within a pod. @@ -2910,8 +2909,8 @@ spec: will choose a pool based on defaults. type: string run: - description: Run describes a list of run containers, which is - the runtime of the server for the actual test. + description: Run describes a list of run containers. The container + for the test server is always the first container on the list. items: description: A single application container that you want to run within a pod. diff --git a/config/samples/go_example_loadtest.yaml b/config/samples/go_example_loadtest.yaml index 5556b46d..1fc3fd87 100644 --- a/config/samples/go_example_loadtest.yaml +++ b/config/samples/go_example_loadtest.yaml @@ -27,7 +27,7 @@ spec: language: go name: '0' run: - - name: "run" + - name: "main" args: - -c - | @@ -118,7 +118,7 @@ spec: language: go name: '0' run: - - name: "run" + - name: "main" args: - -c - | diff --git a/containers/init/ready/suite_test.go b/containers/init/ready/suite_test.go index 68be8f99..b71385fa 100644 --- a/containers/init/ready/suite_test.go +++ b/containers/init/ready/suite_test.go @@ -24,6 +24,7 @@ import ( . "github.com/onsi/gomega" grpcv1 "github.com/grpc/test-infra/api/v1" + "github.com/grpc/test-infra/config" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -54,7 +55,7 @@ func newTestPod(role string) corev1.Pod { Spec: corev1.PodSpec{ Containers: []corev1.Container{ { - Name: "run", + Name: config.RunContainerName, Ports: []corev1.ContainerPort{ { Name: "driver",