Skip to content

Commit f21dbf0

Browse files
Merge pull request #207 from kopecmartin/tempest-cleanup
Add tempest cleanup opt
2 parents aac94c9 + 2b50779 commit f21dbf0

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

api/bases/test.openstack.org_tempests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ spec:
6262
executions (defaults to 0).
6363
format: int32
6464
type: integer
65+
cleanup:
66+
default: false
67+
description: Activate tempest cleanup. When activated, tempest will
68+
run tempest cleanup after test execution is complete to delete any
69+
resources created by tempest that may have been left out.
70+
type: boolean
6571
configOverwrite:
6672
additionalProperties:
6773
type: string

api/v1beta1/tempest_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@ type TempestSpec struct {
394394
// This allows the user to debug any potential troubles with `oc rsh`.
395395
Debug bool `json:"debug"`
396396

397+
// +kubebuilder:validation:Optional
398+
// +operator-sdk:csv:customresourcedefinitions:type=spec
399+
// +kubebuilder:default:=false
400+
// Activate tempest cleanup. When activated, tempest will run tempest cleanup
401+
// after test execution is complete to delete any resources created by tempest
402+
// that may have been left out.
403+
Cleanup bool `json:"cleanup"`
404+
397405
// +kubebuilder:validation:Optional
398406
// +operator-sdk:csv:customresourcedefinitions:type=spec
399407
// NetworkAttachments is a list of NetworkAttachment resource names to expose

config/crd/bases/test.openstack.org_tempests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ spec:
6262
executions (defaults to 0).
6363
format: int32
6464
type: integer
65+
cleanup:
66+
default: false
67+
description: Activate tempest cleanup. When activated, tempest will
68+
run tempest cleanup after test execution is complete to delete any
69+
resources created by tempest that may have been left out.
70+
type: boolean
6571
configOverwrite:
6672
additionalProperties:
6773
type: string

controllers/tempest_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ func (r *TempestReconciler) generateServiceConfigMaps(
650650
r.setConfigOverwrite(customData, instance.Spec.ConfigOverwrite)
651651

652652
envVars["TEMPEST_DEBUG_MODE"] = r.GetDefaultBool(instance.Spec.Debug)
653+
envVars["TEMPEST_CLEANUP"] = r.GetDefaultBool(instance.Spec.Cleanup)
653654

654655
cms := []util.Template{
655656
// ConfigMap

0 commit comments

Comments
 (0)