@@ -124,6 +124,10 @@ var _ = Describe("App server assets", func() {
124124 "/etc/certs/ols-additional-ca/service-ca.crt" ,
125125 },
126126 CertificateDirectory : "/etc/certs/cert-bundle" ,
127+ ToolsApproval : & utils.ToolsApprovalConfig {
128+ ApprovalType : "tool_annotations" ,
129+ ApprovalTimeout : 600 ,
130+ },
127131 },
128132 LLMProviders : []utils.ProviderConfig {
129133 {
@@ -225,7 +229,7 @@ var _ = Describe("App server assets", func() {
225229 err = yaml .Unmarshal ([]byte (cm .Data [utils .OLSConfigFilename ]), & olsConfigMap )
226230 Expect (err ).NotTo (HaveOccurred ())
227231 Expect (olsConfigMap ).To (HaveKeyWithValue ("ols_config" , HaveKeyWithValue ("tools_approval" , MatchAllKeys (Keys {
228- "approval_type" : Equal ("never " ),
232+ "approval_type" : Equal ("tool_annotations " ),
229233 "approval_timeout" : BeNumerically ("==" , 600 ),
230234 }))))
231235
@@ -257,15 +261,16 @@ var _ = Describe("App server assets", func() {
257261 "approval_timeout" : BeNumerically ("==" , 120 ),
258262 }))))
259263
260- By ("not present when config is nil" )
264+ By ("with default values when config is nil" )
261265 cr .Spec .OLSConfig .ToolsApprovalConfig = nil
262266 cm , err = GenerateOLSConfigMap (testReconcilerInstance , context .TODO (), cr )
263267 Expect (err ).NotTo (HaveOccurred ())
264268 err = yaml .Unmarshal ([]byte (cm .Data [utils .OLSConfigFilename ]), & olsConfigMap )
265269 Expect (err ).NotTo (HaveOccurred ())
266- olsConfig , ok := olsConfigMap ["ols_config" ].(map [string ]interface {})
267- Expect (ok ).To (BeTrue ())
268- Expect (olsConfig ).NotTo (HaveKey ("tools_approval" ))
270+ Expect (olsConfigMap ).To (HaveKeyWithValue ("ols_config" , HaveKeyWithValue ("tools_approval" , MatchAllKeys (Keys {
271+ "approval_type" : Equal ("tool_annotations" ),
272+ "approval_timeout" : BeNumerically ("==" , 600 ),
273+ }))))
269274 })
270275
271276 It ("should generate configmap with token quota limiters" , func () {
@@ -1286,6 +1291,9 @@ ols_config:
12861291 tls_config:
12871292 tls_certificate_path: /etc/certs/lightspeed-tls/tls.crt
12881293 tls_key_path: /etc/certs/lightspeed-tls/tls.key
1294+ tools_approval:
1295+ approval_timeout: 600
1296+ approval_type: tool_annotations
12891297 user_data_collection:
12901298 feedback_disabled: false
12911299 feedback_storage: /app-root/ols-user-data/feedback
@@ -1346,6 +1354,9 @@ ols_config:
13461354 tls_config:
13471355 tls_certificate_path: /etc/certs/lightspeed-tls/tls.crt
13481356 tls_key_path: /etc/certs/lightspeed-tls/tls.key
1357+ tools_approval:
1358+ approval_timeout: 600
1359+ approval_type: tool_annotations
13491360 user_data_collection:
13501361 feedback_disabled: true
13511362 feedback_storage: /app-root/ols-user-data/feedback
@@ -2045,11 +2056,11 @@ var _ = Describe("Helper function unit tests", func() {
20452056 It ("should return error when proxy CA certificate ConfigMap does not exist" , func () {
20462057 cr .Spec .OLSConfig .ProxyConfig = & olsv1alpha1.ProxyConfig {
20472058 ProxyURL : "http://proxy.example.com:8080" ,
2048- ProxyCACertificateRef : & olsv1alpha1.ProxyCACertConfigMapRef {
2049- LocalObjectReference : corev1.LocalObjectReference {
2050- Name : "nonexistent-proxy-ca" ,
2059+ ProxyCACertificateRef : & olsv1alpha1.ProxyCACertConfigMapRef {
2060+ LocalObjectReference : corev1.LocalObjectReference {
2061+ Name : "nonexistent-proxy-ca" ,
2062+ },
20512063 },
2052- },
20532064 }
20542065 // Don't create the ConfigMap - validation should fail
20552066 _ , err := buildOLSConfig (testReconcilerInstance , ctx , cr , false )
0 commit comments