Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/v1alpha1/olsconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ type UserDataCollectionSpec struct {
FeedbackDisabled bool `json:"feedbackDisabled,omitempty"`
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Do Not Collect Transcripts"
TranscriptsDisabled bool `json:"transcriptsDisabled,omitempty"`
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Do Not Collect Config Data"
ConfigDisabled bool `json:"configDisabled,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want a new fields for this or we can make use of TranscriptsDisabled ? @onmete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a separate data/option. Can you remind me if this is exposed to the user/admin, or if there is a single switch about collecting/not collecting data?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onmete I was thinking we will use the other 2 flags ( FeedbackDisabled and TranscriptsDisabled ) to decide if we want to collect Config - pre discussion with @thoraxe . But I am okay with this since we already added the flag .

}

// OLSDataCollectorSpec defines allowed OLS data collector configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ spec:
path: ols.userDataCollection.feedbackDisabled
- displayName: Do Not Collect Transcripts
path: ols.userDataCollection.transcriptsDisabled
- displayName: Do Not Collect Config Data
path: ols.userDataCollection.configDisabled
- displayName: OLS Data Collector Settings
path: olsDataCollector
- description: 'Log level. Valid options are DEBUG, INFO, WARNING, ERROR and CRITICAL. Default: "INFO".'
Expand Down
2 changes: 2 additions & 0 deletions bundle/manifests/ols.openshift.io_olsconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,8 @@ spec:
userDataCollection:
description: User data collection switches
properties:
configDisabled:
type: boolean
feedbackDisabled:
type: boolean
transcriptsDisabled:
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/ols.openshift.io_olsconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,8 @@ spec:
userDataCollection:
description: User data collection switches
properties:
configDisabled:
type: boolean
feedbackDisabled:
type: boolean
transcriptsDisabled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ spec:
path: ols.userDataCollection.feedbackDisabled
- displayName: Do Not Collect Transcripts
path: ols.userDataCollection.transcriptsDisabled
- displayName: Do Not Collect Config Data
path: ols.userDataCollection.configDisabled
- displayName: OLS Data Collector Settings
path: olsDataCollector
- description: 'Log level. Valid options are DEBUG, INFO, WARNING, ERROR and
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/ols_app_server_assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ func (r *OLSConfigReconciler) generateOLSConfigMap(ctx context.Context, cr *olsv
FeedbackStorage: "/app-root/ols-user-data/feedback",
TranscriptsDisabled: cr.Spec.OLSConfig.UserDataCollection.TranscriptsDisabled || !dataCollectorEnabled,
TranscriptsStorage: "/app-root/ols-user-data/transcripts",
ConfigDisabled: cr.Spec.OLSConfig.UserDataCollection.ConfigDisabled || !dataCollectorEnabled,
ConfigStorage: "/app-root/ols-user-data/config",
},
ProxyConfig: proxyConfig,
}
Expand Down
10 changes: 10 additions & 0 deletions internal/controller/ols_app_server_assets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ var _ = Describe("App server assets", func() {
FeedbackStorage: "/app-root/ols-user-data/feedback",
TranscriptsDisabled: false,
TranscriptsStorage: "/app-root/ols-user-data/transcripts",
ConfigDisabled: false,
ConfigStorage: "/app-root/ols-user-data/config",
},
},
LLMProviders: []ProviderConfig{
Expand Down Expand Up @@ -930,6 +932,7 @@ var _ = Describe("App server assets", func() {
cr.Spec.OLSConfig.UserDataCollection = olsv1alpha1.UserDataCollectionSpec{
FeedbackDisabled: true,
TranscriptsDisabled: true,
ConfigDisabled: true,
}
cm, err := r.generateOLSConfigMap(context.TODO(), cr)
Expect(err).NotTo(HaveOccurred())
Expand All @@ -938,6 +941,7 @@ var _ = Describe("App server assets", func() {
Expect(err).NotTo(HaveOccurred())
Expect(olsconfigGenerated.OLSConfig.UserDataCollection.FeedbackDisabled).To(BeTrue())
Expect(olsconfigGenerated.OLSConfig.UserDataCollection.TranscriptsDisabled).To(BeTrue())
Expect(olsconfigGenerated.OLSConfig.UserDataCollection.ConfigDisabled).To(BeTrue())

deployment, err := r.generateOLSDeployment(cr)
Expect(err).NotTo(HaveOccurred())
Expand All @@ -955,13 +959,15 @@ var _ = Describe("App server assets", func() {
cr.Spec.OLSConfig.UserDataCollection = olsv1alpha1.UserDataCollectionSpec{
FeedbackDisabled: false,
TranscriptsDisabled: false,
ConfigDisabled: false,
}
cm, err = r.generateOLSConfigMap(context.TODO(), cr)
Expect(err).NotTo(HaveOccurred())
err = yaml.Unmarshal([]byte(cm.Data[OLSConfigFilename]), &olsconfigGenerated)
Expect(err).NotTo(HaveOccurred())
Expect(olsconfigGenerated.OLSConfig.UserDataCollection.FeedbackDisabled).To(BeFalse())
Expect(olsconfigGenerated.OLSConfig.UserDataCollection.TranscriptsDisabled).To(BeFalse())
Expect(olsconfigGenerated.OLSConfig.UserDataCollection.ConfigDisabled).To(BeFalse())

deployment, err = r.generateOLSDeployment(cr)
Expect(err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -1303,6 +1309,8 @@ ols_config:
tls_certificate_path: /etc/certs/lightspeed-tls/tls.crt
tls_key_path: /etc/certs/lightspeed-tls/tls.key
user_data_collection:
config_disabled: false
config_storage: /app-root/ols-user-data/config
feedback_disabled: false
feedback_storage: /app-root/ols-user-data/feedback
transcripts_disabled: false
Expand Down Expand Up @@ -1359,6 +1367,8 @@ ols_config:
tls_certificate_path: /etc/certs/lightspeed-tls/tls.crt
tls_key_path: /etc/certs/lightspeed-tls/tls.key
user_data_collection:
config_disabled: true
config_storage: /app-root/ols-user-data/config
feedback_disabled: true
feedback_storage: /app-root/ols-user-data/feedback
transcripts_disabled: true
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/ols_app_server_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ func (r *OLSConfigReconciler) telemetryEnabled() (bool, error) {

func (r *OLSConfigReconciler) dataCollectorEnabled(cr *olsv1alpha1.OLSConfig) (bool, error) {
// data collector is enabled in OLS configuration
configEnabled := !(cr.Spec.OLSConfig.UserDataCollection.FeedbackDisabled && cr.Spec.OLSConfig.UserDataCollection.TranscriptsDisabled)
configEnabled := !(cr.Spec.OLSConfig.UserDataCollection.FeedbackDisabled && cr.Spec.OLSConfig.UserDataCollection.TranscriptsDisabled && cr.Spec.OLSConfig.UserDataCollection.ConfigDisabled)
telemetryEnabled, err := r.telemetryEnabled()
if err != nil {
return false, err
Expand Down
2 changes: 2 additions & 0 deletions internal/controller/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ type UserDataCollectionConfig struct {
FeedbackStorage string `json:"feedback_storage,omitempty"`
TranscriptsDisabled bool `json:"transcripts_disabled" default:"false"`
TranscriptsStorage string `json:"transcripts_storage,omitempty"`
ConfigDisabled bool `json:"config_disabled" default:"false"`
ConfigStorage string `json:"config_storage,omitempty"`
}

type UserDataCollectorConfig struct {
Expand Down
2 changes: 2 additions & 0 deletions lightspeed-catalog-4.17/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ properties:
path: ols.userDataCollection.feedbackDisabled
- displayName: Do Not Collect Transcripts
path: ols.userDataCollection.transcriptsDisabled
- displayName: Do Not Collect Config Data
path: ols.userDataCollection.configDisabled
- displayName: OLS Data Collector Settings
path: olsDataCollector
- description: 'Log level. Valid options are DEBUG, INFO, WARNING, ERROR and CRITICAL. Default: "INFO".'
Expand Down
2 changes: 2 additions & 0 deletions lightspeed-catalog-4.18/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ properties:
path: ols.userDataCollection.feedbackDisabled
- displayName: Do Not Collect Transcripts
path: ols.userDataCollection.transcriptsDisabled
- displayName: Do Not Collect Config Data
path: ols.userDataCollection.configDisabled
- displayName: OLS Data Collector Settings
path: olsDataCollector
- description: 'Log level. Valid options are DEBUG, INFO, WARNING, ERROR and CRITICAL. Default: "INFO".'
Expand Down
2 changes: 2 additions & 0 deletions lightspeed-catalog-4.19/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ properties:
path: ols.userDataCollection.feedbackDisabled
- displayName: Do Not Collect Transcripts
path: ols.userDataCollection.transcriptsDisabled
- displayName: Do Not Collect Config Data
path: ols.userDataCollection.configDisabled
- displayName: OLS Data Collector Settings
path: olsDataCollector
- description: 'Log level. Valid options are DEBUG, INFO, WARNING, ERROR and CRITICAL. Default: "INFO".'
Expand Down