Merge pull request #50864 from mbohlool/update_openapi_aggr
Automatic merge from submit-queue Improvements to OpenAPI aggregation Fixes #50863 Fixes #50011 Related: #50896 Kubernetes-commit: 75e111ad8713835161ac56e7fd95cdeb51b2f9ad
This commit is contained in:
		
						commit
						d2421c64dc
					
				|  | @ -405,6 +405,7 @@ func (c completedConfig) New(name string, delegationTarget DelegationTarget) (*G | |||
| 		requestContextMapper:   c.RequestContextMapper, | ||||
| 		Serializer:             c.Serializer, | ||||
| 		AuditBackend:           c.AuditBackend, | ||||
| 		delegationTarget:       delegationTarget, | ||||
| 
 | ||||
| 		minRequestTimeout: time.Duration(c.MinRequestTimeout) * time.Second, | ||||
| 
 | ||||
|  |  | |||
|  | @ -145,6 +145,9 @@ type GenericAPIServer struct { | |||
| 	// enableAPIResponseCompression indicates whether API Responses should support compression
 | ||||
| 	// if the client requests it via Accept-Encoding
 | ||||
| 	enableAPIResponseCompression bool | ||||
| 
 | ||||
| 	// delegationTarget is the next delegate in the chain or nil
 | ||||
| 	delegationTarget DelegationTarget | ||||
| } | ||||
| 
 | ||||
| // DelegationTarget is an interface which allows for composition of API servers with top level handling that works
 | ||||
|  | @ -165,6 +168,9 @@ type DelegationTarget interface { | |||
| 
 | ||||
| 	// ListedPaths returns the paths for supporting an index
 | ||||
| 	ListedPaths() []string | ||||
| 
 | ||||
| 	// NextDelegate returns the next delegationTarget in the chain of delegations
 | ||||
| 	NextDelegate() DelegationTarget | ||||
| } | ||||
| 
 | ||||
| func (s *GenericAPIServer) UnprotectedHandler() http.Handler { | ||||
|  | @ -181,6 +187,10 @@ func (s *GenericAPIServer) ListedPaths() []string { | |||
| 	return s.listedPathProvider.ListedPaths() | ||||
| } | ||||
| 
 | ||||
| func (s *GenericAPIServer) NextDelegate() DelegationTarget { | ||||
| 	return s.delegationTarget | ||||
| } | ||||
| 
 | ||||
| var EmptyDelegate = emptyDelegate{ | ||||
| 	requestContextMapper: apirequest.NewRequestContextMapper(), | ||||
| } | ||||
|  | @ -204,6 +214,9 @@ func (s emptyDelegate) ListedPaths() []string { | |||
| func (s emptyDelegate) RequestContextMapper() apirequest.RequestContextMapper { | ||||
| 	return s.requestContextMapper | ||||
| } | ||||
| func (s emptyDelegate) NextDelegate() DelegationTarget { | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // RequestContextMapper is exposed so that third party resource storage can be build in a different location.
 | ||||
| // TODO refactor third party resource storage
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue