Fix 120739 - Prevent AddUpdateAPIService from blocking on updating spec

This commit is contained in:
Jefftree 2023-09-25 12:38:58 -04:00
parent cdcf49ea12
commit 61603d36d7
2 changed files with 5 additions and 2 deletions

View File

@ -228,7 +228,7 @@ func (s *specAggregator) AddUpdateAPIService(apiService *v1.APIService, handler
s.openAPIVersionedService.UpdateSpecLazy(s.buildMergeSpecLocked())
}
return s.updateServiceLocked(apiService.Name)
return nil
}
// RemoveAPIService removes an api service from OpenAPI aggregation. If it does not exist, no error is returned.

View File

@ -139,7 +139,10 @@ func (c *AggregationController) AddAPIService(handler http.Handler, apiService *
// UpdateAPIService updates API Service's info and handler.
func (c *AggregationController) UpdateAPIService(handler http.Handler, apiService *v1.APIService) {
if err := c.openAPIAggregationManager.AddUpdateAPIService(apiService, handler); err != nil {
if apiService.Spec.Service == nil {
return
}
if err := c.openAPIAggregationManager.UpdateAPIServiceSpec(apiService.Name); err != nil {
utilruntime.HandleError(fmt.Errorf("Error updating APIService %q with err: %v", apiService.Name, err))
}
key := apiService.Name