Fix 120758 - prevent cache Load on uninitialized spec

This commit is contained in:
Jefftree 2023-09-25 12:34:12 -04:00
parent 89d822198f
commit cdcf49ea12

View File

@ -224,6 +224,7 @@ func (s *specAggregator) AddUpdateAPIService(apiService *v1.APIService, handler
apiService: *apiService,
downloader: decorateError(apiService.Name, NewCacheableDownloader(s.downloader, handler)),
}
s.specByAPIServiceName[apiService.Name].spec.Store(cached.Result[*spec.Swagger]{Err: fmt.Errorf("spec for apiservice %s is not yet available", apiService.Name)})
s.openAPIVersionedService.UpdateSpecLazy(s.buildMergeSpecLocked())
}