Skip to content

Commit 9acfd20

Browse files
committed
Rename feedback and transcripts config options
Inverts the boolean semantics so users set true to enable a feature rather than false. - feedbackDisabled was renamed to feedbackEnabled. - transcriptsDisabled was renamed to transcriptsEnabled. Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
1 parent 8fbb40a commit 9acfd20

6 files changed

Lines changed: 25 additions & 19 deletions

File tree

api/v1beta1/openstacklightspeed_types.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,14 @@ type OpenStackLightspeedCore struct {
181181
LLMAPIVersion string `json:"llmAPIVersion,omitempty"`
182182

183183
// +kubebuilder:validation:Optional
184-
// Disable feedback collection
185-
FeedbackDisabled bool `json:"feedbackDisabled,omitempty"`
184+
// +kubebuilder:default=true
185+
// Enable feedback collection
186+
FeedbackEnabled *bool `json:"feedbackEnabled,omitempty"`
186187

187188
// +kubebuilder:validation:Optional
188-
// Disable conversation transcripts collection
189-
TranscriptsDisabled bool `json:"transcriptsDisabled,omitempty"`
189+
// +kubebuilder:default=true
190+
// Enable conversation transcripts collection
191+
TranscriptsEnabled *bool `json:"transcriptsEnabled,omitempty"`
190192

191193
// +kubebuilder:validation:Optional
192194
// +kubebuilder:default={}

bundle/manifests/lightspeed.openstack.org_openstacklightspeeds.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ spec:
7575
This section is not part of the stable API and may change at any time without backward compatibility.
7676
type: object
7777
x-kubernetes-preserve-unknown-fields: true
78-
feedbackDisabled:
79-
description: Disable feedback collection
78+
feedbackEnabled:
79+
default: true
80+
description: Enable feedback collection
8081
type: boolean
8182
llmAPIVersion:
8283
description: LLM API Version for LLM providers that require it (e.g.,
@@ -171,8 +172,9 @@ spec:
171172
tlsCACertBundle:
172173
description: Configmap name containing a CA Certificates bundle
173174
type: string
174-
transcriptsDisabled:
175-
description: Disable conversation transcripts collection
175+
transcriptsEnabled:
176+
default: true
177+
description: Enable conversation transcripts collection
176178
type: boolean
177179
required:
178180
- llmCredentials

config/crd/bases/lightspeed.openstack.org_openstacklightspeeds.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ spec:
7575
This section is not part of the stable API and may change at any time without backward compatibility.
7676
type: object
7777
x-kubernetes-preserve-unknown-fields: true
78-
feedbackDisabled:
79-
description: Disable feedback collection
78+
feedbackEnabled:
79+
default: true
80+
description: Enable feedback collection
8081
type: boolean
8182
llmAPIVersion:
8283
description: LLM API Version for LLM providers that require it (e.g.,
@@ -171,8 +172,9 @@ spec:
171172
tlsCACertBundle:
172173
description: Configmap name containing a CA Certificates bundle
173174
type: string
174-
transcriptsDisabled:
175-
description: Disable conversation transcripts collection
175+
transcriptsEnabled:
176+
default: true
177+
description: Enable conversation transcripts collection
176178
type: boolean
177179
required:
178180
- llmCredentials

internal/controller/lcore_config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ func buildLCoreLlamaStackConfig() map[string]interface{} {
100100
}
101101

102102
func buildLCoreUserDataCollectionConfig(_ *common_helper.Helper, instance *apiv1beta1.OpenStackLightspeed) map[string]interface{} {
103-
feedbackEnabled := !instance.Spec.FeedbackDisabled
104-
transcriptsEnabled := !instance.Spec.TranscriptsDisabled
103+
feedbackEnabled := instance.Spec.FeedbackEnabled == nil || *instance.Spec.FeedbackEnabled
104+
transcriptsEnabled := instance.Spec.TranscriptsEnabled == nil || *instance.Spec.TranscriptsEnabled
105105

106106
return map[string]interface{}{
107107
"feedback_enabled": feedbackEnabled,
@@ -176,7 +176,7 @@ func buildLCoreConversationCacheConfig(h *common_helper.Helper, _ *apiv1beta1.Op
176176

177177
// isDataCollectionEnabled returns true if at least one of feedback or transcripts is enabled.
178178
func isDataCollectionEnabled(instance *apiv1beta1.OpenStackLightspeed) bool {
179-
return !instance.Spec.FeedbackDisabled || !instance.Spec.TranscriptsDisabled
179+
return (instance.Spec.FeedbackEnabled == nil || *instance.Spec.FeedbackEnabled) || (instance.Spec.TranscriptsEnabled == nil || *instance.Spec.TranscriptsEnabled)
180180
}
181181

182182
// buildExporterConfigMap creates the ConfigMap for the dataverse exporter sidecar.

test/kuttl/tests/update-openstacklightspeed/07-update-openstack-lightspeed-instance.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ spec:
2828
llmProjectID: test-project-id-UPDATE
2929
llmDeploymentName: test-deployment-name-UPDATE
3030
llmAPIVersion: v1.1
31-
feedbackDisabled: true
32-
transcriptsDisabled: true
31+
feedbackEnabled: false
32+
transcriptsEnabled: false
3333
logging:
3434
ogxLogLevel: "core=debug,providers=info"
3535
lightspeedStackLogLevel: ERROR

test/kuttl/tests/update-openstacklightspeed/08-assert-openstacklightspeed-update.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ spec:
271271
llmProjectID: test-project-id-UPDATE
272272
llmDeploymentName: test-deployment-name-UPDATE
273273
llmAPIVersion: v1.1
274-
feedbackDisabled: true
275-
transcriptsDisabled: true
274+
feedbackEnabled: false
275+
transcriptsEnabled: false
276276
logging:
277277
ogxLogLevel: "core=debug,providers=info"
278278
lightspeedStackLogLevel: ERROR

0 commit comments

Comments
 (0)