@@ -220,43 +220,12 @@ func (r *ModelCatalogSettingsRepository) CreateCatalogSourceConfig(
220220 return r .GetCatalogSourceConfig (ctx , client , namespace , payload .Id )
221221}
222222
223- const maxConflictRetries = 3
224-
225223func (r * ModelCatalogSettingsRepository ) UpdateCatalogSourceConfig (
226224 ctx context.Context ,
227225 client k8s.KubernetesClientInterface ,
228226 namespace string ,
229227 sourceId string ,
230228 payload models.CatalogSourceConfigPayload ,
231- ) (* models.CatalogSourceConfig , error ) {
232- var lastErr error
233- for attempt := 1 ; attempt <= maxConflictRetries ; attempt ++ {
234- result , err := r .tryUpdateCatalogSourceConfig (ctx , client , namespace , sourceId , payload )
235- if err == nil {
236- return result , nil
237- }
238- if ! errors .Is (err , ErrCatalogSourceConflict ) {
239- return nil , err
240- }
241- lastErr = err
242- if attempt < maxConflictRetries {
243- sessionLogger := ctx .Value (constants .TraceLoggerKey ).(* slog.Logger )
244- sessionLogger .Warn ("configmap conflict detected, retrying" ,
245- "sourceId" , sourceId ,
246- "attempt" , attempt ,
247- "maxRetries" , maxConflictRetries ,
248- )
249- }
250- }
251- return nil , lastErr
252- }
253-
254- func (r * ModelCatalogSettingsRepository ) tryUpdateCatalogSourceConfig (
255- ctx context.Context ,
256- client k8s.KubernetesClientInterface ,
257- namespace string ,
258- sourceId string ,
259- payload models.CatalogSourceConfigPayload ,
260229) (* models.CatalogSourceConfig , error ) {
261230 defaultCM , userCM , err := client .GetAllCatalogSourceConfigs (ctx , namespace )
262231 if err != nil {
@@ -380,6 +349,7 @@ func (r *ModelCatalogSettingsRepository) tryUpdateCatalogSourceConfig(
380349 }
381350
382351 return r .GetCatalogSourceConfig (ctx , client , namespace , sourceId )
352+
383353}
384354
385355func (r * ModelCatalogSettingsRepository ) DeleteCatalogSourceConfig (
0 commit comments