From 98952f17bfaf31eefb51d6808df0dd4f6bd3f5ca Mon Sep 17 00:00:00 2001 From: Andrei Matveyeu Date: Wed, 19 Feb 2025 09:51:49 +0100 Subject: [PATCH 1/5] pass ETOS_WAIT_FOR_* variables to environment provider job Change-Id: If51c1365cb21bce0373c38bb3de42a1374414ef2 --- internal/controller/environmentrequest_controller.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/controller/environmentrequest_controller.go b/internal/controller/environmentrequest_controller.go index ffd1d4ae..bedb8be4 100644 --- a/internal/controller/environmentrequest_controller.go +++ b/internal/controller/environmentrequest_controller.go @@ -281,6 +281,18 @@ func (r EnvironmentRequestReconciler) envVarListFrom(ctx context.Context, enviro Name: "ETOS_ETCD_PORT", Value: environmentrequest.Spec.Config.EtcdPort, }, + { + Name: "ETOS_WAIT_FOR_IUT_TIMEOUT", + Value: environmentrequest.Spec.Config.WaitForTimeout, + }, + { + Name: "ETOS_WAIT_FOR_EXECUTION_SPACE_TIMEOUT", + Value: environmentrequest.Spec.Config.WaitForTimeout, + }, + { + Name: "ETOS_WAIT_FOR_LOG_AREA_TIMEOUT", + Value: environmentrequest.Spec.Config.WaitForTimeout, + }, { // Optional when environmentrequest is not issued by testrun, i. e. created separately. // When the environment request is issued by a testrun, this variable is propagated From 7ee3566521d46ca5f670414b2564c9fb71e1030c Mon Sep 17 00:00:00 2001 From: Andrei Matveyeu Date: Wed, 19 Feb 2025 11:43:32 +0100 Subject: [PATCH 2/5] rebase, passing more variables to environment provider job Change-Id: I9bc5f4343f4d0864eacc3fce2ff79ebf5838f6e7 --- api/v1alpha1/environmentrequest_types.go | 1 - .../environmentrequest_controller.go | 26 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/environmentrequest_types.go b/api/v1alpha1/environmentrequest_types.go index 1ae582ba..28706924 100644 --- a/api/v1alpha1/environmentrequest_types.go +++ b/api/v1alpha1/environmentrequest_types.go @@ -53,7 +53,6 @@ type EnvironmentProviderJobConfig struct { EncryptionKey Var `json:"encryptionKeySecretRef"` EtcdHost string `json:"etcdHost"` EtcdPort string `json:"etcdPort"` - EventDataTimeout string `json:"eventDataTimeout"` GraphQlServer string `json:"graphQlServer"` RoutingKeyTag string `json:"routingKeyTag"` WaitForTimeout string `json:"waitForTimeout"` diff --git a/internal/controller/environmentrequest_controller.go b/internal/controller/environmentrequest_controller.go index bedb8be4..e01e8ab9 100644 --- a/internal/controller/environmentrequest_controller.go +++ b/internal/controller/environmentrequest_controller.go @@ -19,6 +19,7 @@ package controller import ( "context" "fmt" + "os" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -255,8 +256,15 @@ func (r EnvironmentRequestReconciler) envVarListFrom(ctx context.Context, enviro if err != nil { return nil, err } - + dev := "false" + if os.Getenv("DEV") != "" { + dev = os.Getenv("DEV") + } envList := []corev1.EnvVar{ + { + Name: "DEV", + Value: dev, + }, { Name: "REQUEST", Value: environmentrequest.Name, @@ -281,6 +289,10 @@ func (r EnvironmentRequestReconciler) envVarListFrom(ctx context.Context, enviro Name: "ETOS_ETCD_PORT", Value: environmentrequest.Spec.Config.EtcdPort, }, + { + Name: "ETOS_EVENT_DATA_TIMEOUT", + Value: environmentrequest.Spec.Config.EnvironmentProviderEventDataTimeout, + }, { Name: "ETOS_WAIT_FOR_IUT_TIMEOUT", Value: environmentrequest.Spec.Config.WaitForTimeout, @@ -293,6 +305,10 @@ func (r EnvironmentRequestReconciler) envVarListFrom(ctx context.Context, enviro Name: "ETOS_WAIT_FOR_LOG_AREA_TIMEOUT", Value: environmentrequest.Spec.Config.WaitForTimeout, }, + { + Name: "TEST_SUITE_TIMEOUT", + Value: environmentrequest.Spec.Config.EnvironmentProviderTestSuiteTimeout, + }, { // Optional when environmentrequest is not issued by testrun, i. e. created separately. // When the environment request is issued by a testrun, this variable is propagated @@ -330,6 +346,10 @@ func (r EnvironmentRequestReconciler) envVarListFrom(ctx context.Context, enviro Name: "RABBITMQ_PASSWORD", Value: string(eiffelRabbitMQPassword), }, + { + Name: "RABBITMQ_ROUTING_KEY", + Value: environmentrequest.Spec.Config.RoutingKeyTag, + }, // ETOS Message Bus variables { @@ -360,6 +380,10 @@ func (r EnvironmentRequestReconciler) envVarListFrom(ctx context.Context, enviro Name: "ETOS_RABBITMQ_PASSWORD", Value: string(etosRabbitMQPassword), }, + { + Name: "ETOS_ROUTING_KEY_TAG", + Value: environmentrequest.Spec.Config.RoutingKeyTag, + }, } return envList, nil } From aed7127e6ebc7c09ee6961e1cf3e488981602bfa Mon Sep 17 00:00:00 2001 From: Andrei Matveyeu Date: Wed, 19 Feb 2025 12:53:18 +0100 Subject: [PATCH 3/5] EventDataTimeout references removed Change-Id: I8e312ee3c33a0ec07d9d0f07a69ce68da8a61d85 --- internal/controller/testrun_controller.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/controller/testrun_controller.go b/internal/controller/testrun_controller.go index f3d27476..3faa6d3d 100644 --- a/internal/controller/testrun_controller.go +++ b/internal/controller/testrun_controller.go @@ -500,7 +500,6 @@ func (r TestRunReconciler) environmentRequest(cluster *etosv1alpha1.Cluster, tes GraphQlServer: eventRepository, EtcdHost: databaseHost, EtcdPort: databasePort, - EventDataTimeout: cluster.Spec.ETOS.Config.EventDataTimeout, WaitForTimeout: cluster.Spec.ETOS.Config.EnvironmentTimeout, EnvironmentProviderEventDataTimeout: cluster.Spec.ETOS.Config.EventDataTimeout, EnvironmentProviderImage: cluster.Spec.ETOS.EnvironmentProvider.Image.Image, From 4ad687db51e3756b1ba6428ffb7bab7a9dcc8ab1 Mon Sep 17 00:00:00 2001 From: Andrei Matveyeu Date: Wed, 19 Feb 2025 13:17:56 +0100 Subject: [PATCH 4/5] autogenerated code update Change-Id: I357c13e43197d346ebb17c4137ad49de235418b8 --- .../etos.eiffel-community.github.io_environmentrequests.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/crd/bases/etos.eiffel-community.github.io_environmentrequests.yaml b/config/crd/bases/etos.eiffel-community.github.io_environmentrequests.yaml index e4338345..140397d9 100644 --- a/config/crd/bases/etos.eiffel-community.github.io_environmentrequests.yaml +++ b/config/crd/bases/etos.eiffel-community.github.io_environmentrequests.yaml @@ -317,8 +317,6 @@ spec: default: / type: string type: object - eventDataTimeout: - type: string graphQlServer: type: string routingKeyTag: @@ -339,7 +337,6 @@ spec: - etcdPort - etosApi - etosMessageBus - - eventDataTimeout - graphQlServer - routingKeyTag - testRunnerVersion From 10e376cfa8f8d6fc235d7dc3c94bf44b0fe82765 Mon Sep 17 00:00:00 2001 From: Andrei Matveyeu Date: Thu, 20 Feb 2025 10:52:41 +0100 Subject: [PATCH 5/5] removed DEV envvar, added ENVIRONMENT_PROVIDER_WAIT* envvars Change-Id: Ic2a64dc7cfec616378b392d50348399487dca567 --- .../environmentrequest_controller.go | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/internal/controller/environmentrequest_controller.go b/internal/controller/environmentrequest_controller.go index e01e8ab9..92006d7a 100644 --- a/internal/controller/environmentrequest_controller.go +++ b/internal/controller/environmentrequest_controller.go @@ -19,7 +19,6 @@ package controller import ( "context" "fmt" - "os" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -256,15 +255,7 @@ func (r EnvironmentRequestReconciler) envVarListFrom(ctx context.Context, enviro if err != nil { return nil, err } - dev := "false" - if os.Getenv("DEV") != "" { - dev = os.Getenv("DEV") - } envList := []corev1.EnvVar{ - { - Name: "DEV", - Value: dev, - }, { Name: "REQUEST", Value: environmentrequest.Name, @@ -293,18 +284,31 @@ func (r EnvironmentRequestReconciler) envVarListFrom(ctx context.Context, enviro Name: "ETOS_EVENT_DATA_TIMEOUT", Value: environmentrequest.Spec.Config.EnvironmentProviderEventDataTimeout, }, + // Duplicate wait timeout variables will be possible to remove when this issue is solved: https://github.com/eiffel-community/etos/issues/304 { Name: "ETOS_WAIT_FOR_IUT_TIMEOUT", Value: environmentrequest.Spec.Config.WaitForTimeout, }, + { + Name: "ENVIRONMENT_PROVIDER_WAIT_FOR_IUT_TIMEOUT", + Value: environmentrequest.Spec.Config.WaitForTimeout, + }, { Name: "ETOS_WAIT_FOR_EXECUTION_SPACE_TIMEOUT", Value: environmentrequest.Spec.Config.WaitForTimeout, }, + { + Name: "ENVIRONMENT_PROVIDER_WAIT_FOR_EXECUTION_SPACE_TIMEOUT", + Value: environmentrequest.Spec.Config.WaitForTimeout, + }, { Name: "ETOS_WAIT_FOR_LOG_AREA_TIMEOUT", Value: environmentrequest.Spec.Config.WaitForTimeout, }, + { + Name: "ENVIRONMENT_PROVIDER_WAIT_FOR_LOG_AREA_TIMEOUT", + Value: environmentrequest.Spec.Config.WaitForTimeout, + }, { Name: "TEST_SUITE_TIMEOUT", Value: environmentrequest.Spec.Config.EnvironmentProviderTestSuiteTimeout,