Skip to content

Commit ef9dd6a

Browse files
committed
Collect config when feedback or transcripts are enabled
1 parent 1742207 commit ef9dd6a

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

api/v1alpha1/olsconfig_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,10 @@ type ProviderSpec struct {
388388
// UserDataCollectionSpec defines how we collect user data.
389389
type UserDataCollectionSpec struct {
390390
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Do Not Collect User Feedback"
391+
// When enabled, user feedback will be collected. When either feedback or transcripts are enabled, config collection is also automatically enabled.
391392
FeedbackDisabled bool `json:"feedbackDisabled,omitempty"`
392393
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Do Not Collect Transcripts"
394+
// When enabled, conversation transcripts will be collected. When either feedback or transcripts are enabled, config collection is also automatically enabled.
393395
TranscriptsDisabled bool `json:"transcriptsDisabled,omitempty"`
394396
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Do Not Collect Config Data"
395397
ConfigDisabled bool `json:"configDisabled,omitempty"`

config/crd/bases/ols.openshift.io_olsconfigs.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,8 +1272,14 @@ spec:
12721272
configDisabled:
12731273
type: boolean
12741274
feedbackDisabled:
1275+
description: When enabled, user feedback will be collected.
1276+
When either feedback or transcripts are enabled, config
1277+
collection is also automatically enabled.
12751278
type: boolean
12761279
transcriptsDisabled:
1280+
description: When enabled, conversation transcripts will be
1281+
collected. When either feedback or transcripts are enabled,
1282+
config collection is also automatically enabled.
12771283
type: boolean
12781284
type: object
12791285
required:

internal/controller/ols_app_server_assets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func (r *OLSConfigReconciler) generateOLSConfigMap(ctx context.Context, cr *olsv
279279
FeedbackStorage: "/app-root/ols-user-data/feedback",
280280
TranscriptsDisabled: cr.Spec.OLSConfig.UserDataCollection.TranscriptsDisabled || !dataCollectorEnabled,
281281
TranscriptsStorage: "/app-root/ols-user-data/transcripts",
282-
ConfigDisabled: cr.Spec.OLSConfig.UserDataCollection.ConfigDisabled || !dataCollectorEnabled,
282+
ConfigDisabled: !dataCollectorEnabled,
283283
ConfigStorage: "/app-root/ols-user-data/config",
284284
},
285285
ProxyConfig: proxyConfig,

internal/controller/ols_app_server_deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func (r *OLSConfigReconciler) telemetryEnabled() (bool, error) {
529529

530530
func (r *OLSConfigReconciler) dataCollectorEnabled(cr *olsv1alpha1.OLSConfig) (bool, error) {
531531
// data collector is enabled in OLS configuration
532-
configEnabled := !(cr.Spec.OLSConfig.UserDataCollection.FeedbackDisabled && cr.Spec.OLSConfig.UserDataCollection.TranscriptsDisabled && cr.Spec.OLSConfig.UserDataCollection.ConfigDisabled)
532+
configEnabled := !cr.Spec.OLSConfig.UserDataCollection.FeedbackDisabled || !cr.Spec.OLSConfig.UserDataCollection.TranscriptsDisabled
533533
telemetryEnabled, err := r.telemetryEnabled()
534534
if err != nil {
535535
return false, err

0 commit comments

Comments
 (0)