Skip to content

Commit

Permalink
Merge pull request #204 from ashu-011/horizontest_debug_mode
Browse files Browse the repository at this point in the history
Add debug mode for Horizontest
  • Loading branch information
openshift-merge-bot[bot] authored Sep 30, 2024
2 parents 8d8bbfb + 88403b3 commit da008eb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/bases/test.openstack.org_horizontests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ spec:
dashboardUrl:
description: DashboardUrl is the URL of the Horizon dashboard.
type: string
debug:
default: false
description: Activate debug mode. When debug mode is activated any
error encountered inside the test-pod causes that the pod will be
kept alive indefinitely (stuck in "Running" phase) or until the
corresponding HorizonTest CR is deleted. This allows the user to
debug any potential troubles with `oc rsh`.
type: boolean
extraConfigmapsMounts:
description: Extra configmaps for mounting inside the pod
items:
Expand Down
8 changes: 8 additions & 0 deletions api/v1beta1/horizontest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ import (
type HorizonTestSpec struct {
CommonOptions `json:",inline"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// Activate debug mode. When debug mode is activated any error encountered
// inside the test-pod causes that the pod will be kept alive indefinitely
// (stuck in "Running" phase) or until the corresponding HorizonTest CR is deleted.
// This allows the user to debug any potential troubles with `oc rsh`.
Debug bool `json:"debug"`

// AdminUsername is the username for the OpenStack admin user.
// +kubebuilder:validation:Required
// +operator-sdk:csv:customresourcedefinitions:type=spec
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/test.openstack.org_horizontests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ spec:
dashboardUrl:
description: DashboardUrl is the URL of the Horizon dashboard.
type: string
debug:
default: false
description: Activate debug mode. When debug mode is activated any
error encountered inside the test-pod causes that the pod will be
kept alive indefinitely (stuck in "Running" phase) or until the
corresponding HorizonTest CR is deleted. This allows the user to
debug any potential troubles with `oc rsh`.
type: boolean
extraConfigmapsMounts:
description: Extra configmaps for mounting inside the pod
items:
Expand Down
1 change: 1 addition & 0 deletions config/samples/test_v1beta1_horizontest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ metadata:
name: horizontest-sample
spec:
containerImage: ""
# debug: false

# OpenStack admin credentials
adminUsername: "admin"
Expand Down
1 change: 1 addition & 0 deletions controllers/horizontest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ func (r *HorizonTestReconciler) PrepareHorizonTestEnvVars(
envVars["PASSWORD"] = env.SetValue("horizontest")
envVars["FLAVOR_NAME"] = env.SetValue("m1.tiny")
envVars["HORIZON_KEYS_FOLDER"] = env.SetValue("/etc/test_operator")
envVars["HORIZONTEST_DEBUG_MODE"] = env.SetValue(r.GetDefaultBool(instance.Spec.Debug))

return envVars
}

0 comments on commit da008eb

Please sign in to comment.