From 652b0bb37b14a3e99d4f9e3de2a005e7ba988f6e Mon Sep 17 00:00:00 2001
From: Povilas Versockas
Date: Mon, 9 Oct 2023 10:50:40 +0300
Subject: [PATCH] feat: add readonly flag to test-suites (#4448)
---
api/v1/testkube.yaml | 3 +++
pkg/api/v1/testkube/model_test_suite.go | 2 ++
pkg/api/v1/testkube/model_test_suite_update_request.go | 2 ++
pkg/api/v1/testkube/model_test_suite_upsert_request.go | 2 ++
4 files changed, 9 insertions(+)
diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml
index c26be4262d5..2f540d52101 100644
--- a/api/v1/testkube.yaml
+++ b/api/v1/testkube.yaml
@@ -3435,6 +3435,9 @@ components:
$ref: "#/components/schemas/TestSuiteExecutionRequest"
status:
$ref: "#/components/schemas/TestSuiteStatus"
+ readOnly:
+ type: boolean
+ description: if test suite is offline and cannot be executed
TestSuiteV2:
type: object
diff --git a/pkg/api/v1/testkube/model_test_suite.go b/pkg/api/v1/testkube/model_test_suite.go
index ff5158d6bd6..aef3cd5113a 100644
--- a/pkg/api/v1/testkube/model_test_suite.go
+++ b/pkg/api/v1/testkube/model_test_suite.go
@@ -31,4 +31,6 @@ type TestSuite struct {
Created time.Time `json:"created,omitempty"`
ExecutionRequest *TestSuiteExecutionRequest `json:"executionRequest,omitempty"`
Status *TestSuiteStatus `json:"status"`
+ // if test suite is offline and cannot be executed
+ ReadOnly bool `json:"readOnly,omitempty"`
}
diff --git a/pkg/api/v1/testkube/model_test_suite_update_request.go b/pkg/api/v1/testkube/model_test_suite_update_request.go
index 988026468e2..f726b06d5ba 100644
--- a/pkg/api/v1/testkube/model_test_suite_update_request.go
+++ b/pkg/api/v1/testkube/model_test_suite_update_request.go
@@ -34,4 +34,6 @@ type TestSuiteUpdateRequest struct {
Created time.Time `json:"created,omitempty"`
ExecutionRequest **TestSuiteExecutionUpdateRequest `json:"executionRequest,omitempty"`
Status *TestSuiteStatus `json:"status"`
+ // if test suite is offline and cannot be executed
+ ReadOnly *bool `json:"readOnly,omitempty"`
}
diff --git a/pkg/api/v1/testkube/model_test_suite_upsert_request.go b/pkg/api/v1/testkube/model_test_suite_upsert_request.go
index a6f512f4c3b..dc6478217e4 100644
--- a/pkg/api/v1/testkube/model_test_suite_upsert_request.go
+++ b/pkg/api/v1/testkube/model_test_suite_upsert_request.go
@@ -34,4 +34,6 @@ type TestSuiteUpsertRequest struct {
Created time.Time `json:"created,omitempty"`
ExecutionRequest *TestSuiteExecutionRequest `json:"executionRequest,omitempty"`
Status *TestSuiteStatus `json:"status"`
+ // if test suite is offline and cannot be executed
+ ReadOnly bool `json:"readOnly,omitempty"`
}