Skip to content
Merged
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
# Ignore build and test binaries.
bin/
bin
dist/install.yaml
config
85 changes: 82 additions & 3 deletions api/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// MongoDB describes the deployment of a MongoDB.
type MongoDB struct {
// +kubebuilder:default=false
// +optional
Expand All @@ -30,6 +31,7 @@ type MongoDB struct {
URI Var `json:"uri"`
}

// EventRepository describes the deployment of an event repository for ETOS.
type EventRepository struct {
// Deploy a local event repository for a cluster.
// +kubebuilder:default=false
Expand All @@ -47,6 +49,12 @@ type EventRepository struct {
// +kubebuilder:default={"image": "registry.nordix.org/eiffel/eiffel-graphql-storage:latest"}
// +optional
Storage Image `json:"storage"`
// +kubebuilder:default="etos"
// +optional
EiffelQueueName string `json:"eiffelQueueName,omitempty"`
// +kubebuilder:default=""
// +optional
EiffelQueueParams string `json:"eiffelQueueParams,omitempty"`

// +kubebuilder:default={}
// +optional
Expand All @@ -59,15 +67,15 @@ type EventRepository struct {
Ingress Ingress `json:"ingress"`
}

// MessageBus describes the deployment of messagesbuses for ETOS.
type MessageBus struct {
// +kubebuilder:default={"queueName": "etos"}
// +optional
EiffelMessageBus RabbitMQ `json:"eiffel"`
// +kubebuilder:default={"queueName": "etos-*-temp"}
// +optional
ETOSMessageBus RabbitMQ `json:"logs"`
}

// Etcd describes the deployment of an ETCD database.
type Etcd struct {
// Parameter is ignored if Deploy is set to true.
// +kubebuilder:default="etcd-client"
Expand All @@ -79,6 +87,7 @@ type Etcd struct {
Port string `json:"port"`
}

// Database describes the deployment of a database for ETOS.
type Database struct {
// +kubebuilder:default=true
// +optional
Expand All @@ -88,31 +97,97 @@ type Database struct {
Etcd Etcd `json:"etcd"`
}

// ETOSAPI describes the deployment of the ETOS API.
type ETOSAPI struct {
Image `json:",inline"`
// The provider secrets are necessary in order deploy and run ETOS without using the
// kubernetes controller.
// They can be removed from here when the suite starter is no longer in use.
// +optional
IUTProviderSecret string `json:"iutProviderSecret"`
// +optional
ExecutionSpaceProviderSecret string `json:"executionSpaceProviderSecret"`
// +optional
LogAreaProviderSecret string `json:"logAreaProviderSecret"`
}

// ETOSSuiteStarterConfig describes the configuration required for a suite starter.
// This is separate from the ETOSConfig as we want to remove this in the future when the suite
// starter is no longer in use.
type ETOSSuiteStarterConfig struct {
// +kubebuilder:default="3600"
// +optional
TTL string `json:"ttl,omitempty"`
// +kubebuilder:default=""
// +optional
ObservabilityConfigmapName string `json:"observabilityConfigmapName,omitempty"`
// +kubebuilder:default="300"
// +optional
GracePeriod string `json:"gracePeriod,omitempty"`
// +kubebuilder:default=""
// +optional
SidecarImage string `json:"sidecarImage,omitempty"`
// +kubebuilder:default=""
// +optional
OTELCollectorHost string `json:"otelCollectorHost,omitempty"`
}

// ETOSSuiteStarter describes the deployment of an ETOS suite starter.
type ETOSSuiteStarter struct {
Image `json:",inline"`
// +kubebuilder:default="etos-suite-starter"
// +optional
EiffelQueueName string `json:"eiffelQueueName,omitempty"`
// +kubebuilder:default=""
// +optional
EiffelQueueParams string `json:"eiffelQueueParams,omitempty"`
// Provide a custom suite runner template.
// +kubebuilder:default=""
// +optional
SuiteRunnerTemplateSecretName string `json:"suiteRunnerTemplateSecretName,omitempty"`
// +kubebuilder:default={"ttl": "3600", "gracePeriod": "300"}
// +optional
Config ETOSSuiteStarterConfig `json:"config"`
}

// ETOSSSE describes th deployment of an ETOS Server Sent Events API.
type ETOSSSE struct {
Image `json:",inline"`
}

// ETOSLogArea describes th deployment of an ETOS log area API.
type ETOSLogArea struct {
Image `json:",inline"`
}

// ETOSLogListener describes the deployment of an ETOS log listener.
type ETOSLogListener struct {
Image `json:",inline"`
// +kubebuilder:default="etos-*-temp"
// +optional
ETOSQueueName string `json:"etosQueueName,omitempty"`
// +kubebuilder:default=""
// +optional
ETOSQueueParams string `json:"etosQueueParams,omitempty"`
}

// ETOSSuiteRunner describes the deployment of an ETOS suite runner.
type ETOSSuiteRunner struct {
Image `json:",inline"`
LogListener Image `json:"logListener"`
LogListener ETOSLogListener `json:"logListener"`
}

// ETOSTestRunner describes the deployment of an ETOS test runner.
type ETOSTestRunner struct {
Version string `json:"version"`
}

// ETOSEnvironmentProvider describes the deployment of an ETOS environment provider.
type ETOSEnvironmentProvider struct {
Image `json:",inline"`
}

// ETOSConfig describes a common configuration for ETOS.
type ETOSConfig struct {
// +kubebuilder:default="true"
// +optional
Expand Down Expand Up @@ -146,6 +221,7 @@ type ETOSConfig struct {
Timezone string `json:"timezone,omitempty"`
}

// ETOS describes the deployment of an ETOS cluster.
type ETOS struct {
// +kubebuilder:default={"image": "registry.nordix.org/eiffel/etos-api:latest"}
// +optional
Expand All @@ -162,6 +238,9 @@ type ETOS struct {
// +kubebuilder:default={"version": "latest"}
// +optional
TestRunner ETOSTestRunner `json:"testRunner"`
// +kubebuilder:default={"image": "registry.nordix.org/eiffel/etos-suite-starter:latest"}
// +optional
SuiteStarter ETOSSuiteStarter `json:"suiteStarter"`
// +kubebuilder:default={"image": "registry.nordix.org/eiffel/etos-environment-provider:latest"}
// +optional
EnvironmentProvider ETOSEnvironmentProvider `json:"environmentProvider"`
Expand Down
4 changes: 1 addition & 3 deletions api/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,5 @@ type RabbitMQ struct {
SSL string `json:"ssl"`
// +kubebuilder:default=/
// +optional
Vhost string `json:"vhost"`
QueueName string `json:"queueName,omitempty"`
QueueParams string `json:"queueParams,omitempty"`
Vhost string `json:"vhost"`
}
11 changes: 6 additions & 5 deletions api/v1alpha1/environment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ type EnvironmentSpec struct {
Name string `json:"name"`

// Snake casing as to be compatible with ETR.
// Regexes match any UUID version.

// +kubebuilder:validation:Pattern="[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
// +kubebuilder:validation:Pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
SuiteID string `json:"suite_id"`
// +kubebuilder:validation:Pattern="[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
// +kubebuilder:validation:Pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
SubSuiteID string `json:"sub_suite_id"`
// +kubebuilder:validation:Pattern="[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
// +kubebuilder:validation:Pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
MainSuiteID string `json:"test_suite_started_id"`
// +kubebuilder:validation:Pattern="[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
// +kubebuilder:validation:Pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
Artifact string `json:"artifact"`
// +kubebuilder:validation:Pattern="[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
// +kubebuilder:validation:Pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
Context string `json:"context"`

Priority int `json:"priority"`
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/environmentrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ type Splitter struct {

// EnvironmentRequestSpec defines the desired state of EnvironmentRequest
type EnvironmentRequestSpec struct {
// ID is the ID for the environments generated. Will be generated if nil
// +kubebuilder:validation:Pattern="[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
// ID is the ID for the environments generated. Will be generated if nil. The ID is a UUID, any version, and regex matches that.
// +kubebuilder:validation:Pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`

Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/testrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ type TestRunSpec struct {
// Name of the ETOS cluster to execute the testrun in.
Cluster string `json:"cluster,omitempty"`

// ID is the test suite ID for this execution. Will be generated if nil
// +kubebuilder:validation:Pattern="[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
// ID is the test suite ID for this execution. Will be generated if nil. The ID is a UUID, any version, and regex matches that.
// +kubebuilder:validation:Pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
ID string `json:"id,omitempty"`

// Artifact is the ID of the software under test.
// +kubebuilder:validation:Pattern="[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}"
// Artifact is the ID of the software under test. The ID is a UUID, any version, and regex matches that.
// +kubebuilder:validation:Pattern="^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
Artifact string `json:"artifact"`

// +optional
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/testrun_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (r *TestRun) Default() {
r.Spec.SuiteRunner = &SuiteRunner{&cluster.Spec.ETOS.SuiteRunner.Image}
}
if r.Spec.LogListener == nil && cluster != nil {
r.Spec.LogListener = &LogListener{&cluster.Spec.ETOS.SuiteRunner.LogListener}
r.Spec.LogListener = &LogListener{&cluster.Spec.ETOS.SuiteRunner.LogListener.Image}
}
if r.Spec.EnvironmentProvider == nil && cluster != nil {
r.Spec.EnvironmentProvider = &EnvironmentProvider{&cluster.Spec.ETOS.EnvironmentProvider.Image}
Expand Down
49 changes: 49 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading