mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Enable API chunking and promote to beta for 1.9
All list watchers default to using chunking.
This commit is contained in:
parent
46c2bfe47d
commit
113889e72d
@ -201,7 +201,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
|
|||||||
genericfeatures.AdvancedAuditing: {Default: true, PreRelease: utilfeature.Beta},
|
genericfeatures.AdvancedAuditing: {Default: true, PreRelease: utilfeature.Beta},
|
||||||
genericfeatures.APIResponseCompression: {Default: false, PreRelease: utilfeature.Alpha},
|
genericfeatures.APIResponseCompression: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
genericfeatures.Initializers: {Default: false, PreRelease: utilfeature.Alpha},
|
genericfeatures.Initializers: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
genericfeatures.APIListChunking: {Default: false, PreRelease: utilfeature.Alpha},
|
genericfeatures.APIListChunking: {Default: true, PreRelease: utilfeature.Beta},
|
||||||
|
|
||||||
// inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed
|
// inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed
|
||||||
// unintentionally on either side:
|
// unintentionally on either side:
|
||||||
|
@ -58,6 +58,7 @@ const (
|
|||||||
|
|
||||||
// owner: @smarterclayton
|
// owner: @smarterclayton
|
||||||
// alpha: v1.8
|
// alpha: v1.8
|
||||||
|
// beta: v1.9
|
||||||
//
|
//
|
||||||
// Allow API clients to retrieve resource lists in chunks rather than
|
// Allow API clients to retrieve resource lists in chunks rather than
|
||||||
// all at once.
|
// all at once.
|
||||||
@ -76,5 +77,5 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
|
|||||||
AdvancedAuditing: {Default: true, PreRelease: utilfeature.Beta},
|
AdvancedAuditing: {Default: true, PreRelease: utilfeature.Beta},
|
||||||
APIResponseCompression: {Default: false, PreRelease: utilfeature.Alpha},
|
APIResponseCompression: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
Initializers: {Default: false, PreRelease: utilfeature.Alpha},
|
Initializers: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
APIListChunking: {Default: false, PreRelease: utilfeature.Alpha},
|
APIListChunking: {Default: true, PreRelease: utilfeature.Beta},
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,7 @@ type WatchFunc func(options metav1.ListOptions) (watch.Interface, error)
|
|||||||
type ListWatch struct {
|
type ListWatch struct {
|
||||||
ListFunc ListFunc
|
ListFunc ListFunc
|
||||||
WatchFunc WatchFunc
|
WatchFunc WatchFunc
|
||||||
// DisableChunking requests no chunking for this list watcher. It has no effect in Kubernetes 1.8, but in
|
// DisableChunking requests no chunking for this list watcher.
|
||||||
// 1.9 will allow a controller to opt out of chunking.
|
|
||||||
DisableChunking bool
|
DisableChunking bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,9 +92,7 @@ func timeoutFromListOptions(options metav1.ListOptions) time.Duration {
|
|||||||
|
|
||||||
// List a set of apiserver resources
|
// List a set of apiserver resources
|
||||||
func (lw *ListWatch) List(options metav1.ListOptions) (runtime.Object, error) {
|
func (lw *ListWatch) List(options metav1.ListOptions) (runtime.Object, error) {
|
||||||
// chunking will become the default for list watchers starting in Kubernetes 1.9, unless
|
if !lw.DisableChunking {
|
||||||
// otherwise disabled.
|
|
||||||
if false && !lw.DisableChunking {
|
|
||||||
return pager.New(pager.SimplePageFunc(lw.ListFunc)).List(context.TODO(), options)
|
return pager.New(pager.SimplePageFunc(lw.ListFunc)).List(context.TODO(), options)
|
||||||
}
|
}
|
||||||
return lw.ListFunc(options)
|
return lw.ListFunc(options)
|
||||||
|
Loading…
Reference in New Issue
Block a user