From 3df92362abd978edac66ac0ce4c9f8d3a359f882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20K=C5=99epinsk=C3=BD?= Date: Mon, 26 Jun 2023 18:41:10 +0200 Subject: [PATCH] fix openapi/v3 non local apiservices aggregation When resyncing APIServices (every minute), the AggregationController calls AddUpdateAPIService immediately, but it may take some time before the reconciliation of the controller calls UpdateAPIServiceSpec. This results in a temporary downtime of discovery of these APIServices, which will stop reporting of these in the aggregated openapi/v3 by specProxier. This fix ensures that old discovery is kept during a time, when the AggregationController is reconciling. --- .../pkg/controllers/openapiv3/aggregator/aggregator.go | 1 + 1 file changed, 1 insertion(+) diff --git a/staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator.go b/staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator.go index 2d79554f756..0b38e10fda4 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/controllers/openapiv3/aggregator/aggregator.go @@ -114,6 +114,7 @@ func (s *specProxier) AddUpdateAPIService(handler http.Handler, apiservice *v1.A if apiServiceInfo, ok := s.apiServiceInfo[apiservice.Name]; ok { apiServiceInfo.apiService = *apiservice apiServiceInfo.handler = handler + return } s.apiServiceInfo[apiservice.Name] = &openAPIV3APIServiceInfo{ apiService: *apiservice,