mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Provide whole delegate chain to kube aggregator
This commit is contained in:
parent
28857a2f02
commit
7cbdb90890
@ -405,6 +405,7 @@ func (c completedConfig) New(name string, delegationTarget DelegationTarget) (*G
|
|||||||
requestContextMapper: c.RequestContextMapper,
|
requestContextMapper: c.RequestContextMapper,
|
||||||
Serializer: c.Serializer,
|
Serializer: c.Serializer,
|
||||||
AuditBackend: c.AuditBackend,
|
AuditBackend: c.AuditBackend,
|
||||||
|
delegationTarget: delegationTarget,
|
||||||
|
|
||||||
minRequestTimeout: time.Duration(c.MinRequestTimeout) * time.Second,
|
minRequestTimeout: time.Duration(c.MinRequestTimeout) * time.Second,
|
||||||
|
|
||||||
|
@ -145,6 +145,9 @@ type GenericAPIServer struct {
|
|||||||
// enableAPIResponseCompression indicates whether API Responses should support compression
|
// enableAPIResponseCompression indicates whether API Responses should support compression
|
||||||
// if the client requests it via Accept-Encoding
|
// if the client requests it via Accept-Encoding
|
||||||
enableAPIResponseCompression bool
|
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
|
// 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 returns the paths for supporting an index
|
||||||
ListedPaths() []string
|
ListedPaths() []string
|
||||||
|
|
||||||
|
// NextDelegate returns the next delegationTarget in the chain of delegations
|
||||||
|
NextDelegate() DelegationTarget
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *GenericAPIServer) UnprotectedHandler() http.Handler {
|
func (s *GenericAPIServer) UnprotectedHandler() http.Handler {
|
||||||
@ -181,6 +187,10 @@ func (s *GenericAPIServer) ListedPaths() []string {
|
|||||||
return s.listedPathProvider.ListedPaths()
|
return s.listedPathProvider.ListedPaths()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *GenericAPIServer) NextDelegate() DelegationTarget {
|
||||||
|
return s.delegationTarget
|
||||||
|
}
|
||||||
|
|
||||||
var EmptyDelegate = emptyDelegate{
|
var EmptyDelegate = emptyDelegate{
|
||||||
requestContextMapper: apirequest.NewRequestContextMapper(),
|
requestContextMapper: apirequest.NewRequestContextMapper(),
|
||||||
}
|
}
|
||||||
@ -204,6 +214,9 @@ func (s emptyDelegate) ListedPaths() []string {
|
|||||||
func (s emptyDelegate) RequestContextMapper() apirequest.RequestContextMapper {
|
func (s emptyDelegate) RequestContextMapper() apirequest.RequestContextMapper {
|
||||||
return s.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.
|
// RequestContextMapper is exposed so that third party resource storage can be build in a different location.
|
||||||
// TODO refactor third party resource storage
|
// TODO refactor third party resource storage
|
||||||
|
Loading…
Reference in New Issue
Block a user