File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
staging/src/k8s.io/kube-aggregator/pkg/controllers/openapi/aggregator Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -202,15 +202,16 @@ func (s *specAggregator) tryUpdatingServiceSpecs(specInfo *openAPISpecInfo) erro
202
202
if specInfo == nil {
203
203
return fmt .Errorf ("invalid input: specInfo must be non-nil" )
204
204
}
205
- orgSpecInfo , exists := s .openAPISpecs [specInfo .apiService .Name ]
205
+ origSpecInfo , existedBefore := s .openAPISpecs [specInfo .apiService .Name ]
206
+ s .openAPISpecs [specInfo .apiService .Name ] = specInfo
207
+
206
208
// Skip aggregation if OpenAPI spec didn't change
207
- if exists && orgSpecInfo != nil && orgSpecInfo .etag == specInfo .etag {
209
+ if existedBefore && origSpecInfo != nil && origSpecInfo .etag == specInfo .etag {
208
210
return nil
209
211
}
210
- s .openAPISpecs [specInfo .apiService .Name ] = specInfo
211
212
if err := s .updateOpenAPISpec (); err != nil {
212
- if exists {
213
- s .openAPISpecs [specInfo .apiService .Name ] = orgSpecInfo
213
+ if existedBefore {
214
+ s .openAPISpecs [specInfo .apiService .Name ] = origSpecInfo
214
215
} else {
215
216
delete (s .openAPISpecs , specInfo .apiService .Name )
216
217
}
You can’t perform that action at this time.
0 commit comments