make update

Kubernetes-commit: f62c80f965934eeeb2e028497bede7bcc632995d
This commit is contained in:
Lukasz Szaszkiewicz 2024-06-13 10:25:56 +02:00 committed by Kubernetes Publisher
parent e4e31fd32c
commit cc198ea39d
117 changed files with 3806 additions and 585 deletions

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface.
@ -79,13 +81,22 @@ func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, op
}
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) {
defer func() {
func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for mutatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for mutatingwebhookconfigurations", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for mutatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
@ -104,6 +115,22 @@ func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts metav1.Li
return
}
// watchList establishes a watch stream with the server and returns the list of MutatingWebhookConfigurations
func (c *mutatingWebhookConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.MutatingWebhookConfigurationList{}
err = c.client.Get().
Resource("mutatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface.
@ -81,13 +83,22 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) {
defer func() {
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
@ -106,6 +117,22 @@ func (c *validatingAdmissionPolicies) list(ctx context.Context, opts metav1.List
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies
func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ValidatingAdmissionPolicyList{}
err = c.client.Get().
Resource("validatingadmissionpolicies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface.
@ -79,13 +81,22 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) {
defer func() {
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
@ -104,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts metav
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings
func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ValidatingAdmissionPolicyBindingList{}
err = c.client.Get().
Resource("validatingadmissionpolicybindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface.
@ -79,13 +81,22 @@ func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string,
}
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) {
defer func() {
func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingwebhookconfigurations", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for validatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
@ -104,6 +115,22 @@ func (c *validatingWebhookConfigurations) list(ctx context.Context, opts metav1.
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingWebhookConfigurations
func (c *validatingWebhookConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ValidatingWebhookConfigurationList{}
err = c.client.Get().
Resource("validatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface.
@ -81,13 +83,22 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) {
defer func() {
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
@ -106,6 +117,22 @@ func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOpti
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies
func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ValidatingAdmissionPolicyList{}
err = c.client.Get().
Resource("validatingadmissionpolicies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface.
@ -79,13 +81,22 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) {
defer func() {
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
@ -104,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.Li
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings
func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ValidatingAdmissionPolicyBindingList{}
err = c.client.Get().
Resource("validatingadmissionpolicybindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface.
@ -79,13 +81,22 @@ func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, op
}
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) {
defer func() {
func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for mutatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for mutatingwebhookconfigurations", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for mutatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
@ -104,6 +115,22 @@ func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts v1.ListOp
return
}
// watchList establishes a watch stream with the server and returns the list of MutatingWebhookConfigurations
func (c *mutatingWebhookConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.MutatingWebhookConfigurationList{}
err = c.client.Get().
Resource("mutatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface.
@ -81,13 +83,22 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) {
defer func() {
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
@ -106,6 +117,22 @@ func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOpti
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies
func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ValidatingAdmissionPolicyList{}
err = c.client.Get().
Resource("validatingadmissionpolicies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface.
@ -79,13 +81,22 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) {
defer func() {
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
@ -104,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.Li
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings
func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ValidatingAdmissionPolicyBindingList{}
err = c.client.Get().
Resource("validatingadmissionpolicybindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface.
@ -79,13 +81,22 @@ func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string,
}
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) {
defer func() {
func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingwebhookconfigurations", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for validatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
@ -104,6 +115,22 @@ func (c *validatingWebhookConfigurations) list(ctx context.Context, opts v1.List
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingWebhookConfigurations
func (c *validatingWebhookConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ValidatingWebhookConfigurationList{}
err = c.client.Get().
Resource("validatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// StorageVersionsGetter has a method to return a StorageVersionInterface.
@ -81,13 +83,22 @@ func (c *storageVersions) Get(ctx context.Context, name string, options v1.GetOp
}
// List takes label and field selectors, and returns the list of StorageVersions that match those selectors.
func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) {
defer func() {
func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for storageversions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversions", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageversions", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for storageversions ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversions", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of StorageVersions that match those selectors.
@ -106,6 +117,22 @@ func (c *storageVersions) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of StorageVersions
func (c *storageVersions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.StorageVersionList{}
err = c.client.Get().
Resource("storageversions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested storageVersions.
func (c *storageVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ControllerRevisionsGetter has a method to return a ControllerRevisionInterface.
@ -82,13 +84,22 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options meta
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) {
defer func() {
func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
@ -108,6 +119,23 @@ func (c *controllerRevisions) list(ctx context.Context, opts metav1.ListOptions)
return
}
// watchList establishes a watch stream with the server and returns the list of ControllerRevisions
func (c *controllerRevisions) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ControllerRevisionList{}
err = c.client.Get().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested controllerRevisions.
func (c *controllerRevisions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DaemonSetsGetter has a method to return a DaemonSetInterface.
@ -84,13 +86,22 @@ func (c *daemonSets) Get(ctx context.Context, name string, options metav1.GetOpt
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) {
defer func() {
func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of DaemonSets that match those selectors.
@ -110,6 +121,23 @@ func (c *daemonSets) list(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of DaemonSets
func (c *daemonSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.DaemonSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *daemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -34,6 +34,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DeploymentsGetter has a method to return a DeploymentInterface.
@ -90,13 +92,22 @@ func (c *deployments) Get(ctx context.Context, name string, options metav1.GetOp
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) {
defer func() {
func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Deployments that match those selectors.
@ -116,6 +127,23 @@ func (c *deployments) list(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of Deployments
func (c *deployments) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.DeploymentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -34,6 +34,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ReplicaSetsGetter has a method to return a ReplicaSetInterface.
@ -90,13 +92,22 @@ func (c *replicaSets) Get(ctx context.Context, name string, options metav1.GetOp
}
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) {
defer func() {
func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
@ -116,6 +127,23 @@ func (c *replicaSets) list(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of ReplicaSets
func (c *replicaSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ReplicaSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested replicaSets.
func (c *replicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -34,6 +34,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// StatefulSetsGetter has a method to return a StatefulSetInterface.
@ -90,13 +92,22 @@ func (c *statefulSets) Get(ctx context.Context, name string, options metav1.GetO
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) {
defer func() {
func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of StatefulSets that match those selectors.
@ -116,6 +127,23 @@ func (c *statefulSets) list(ctx context.Context, opts metav1.ListOptions) (resul
return
}
// watchList establishes a watch stream with the server and returns the list of StatefulSets
func (c *statefulSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.StatefulSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested statefulSets.
func (c *statefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ControllerRevisionsGetter has a method to return a ControllerRevisionInterface.
@ -82,13 +84,22 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.G
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) {
defer func() {
func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
@ -108,6 +119,23 @@ func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of ControllerRevisions
func (c *controllerRevisions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ControllerRevisionList{}
err = c.client.Get().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested controllerRevisions.
func (c *controllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DeploymentsGetter has a method to return a DeploymentInterface.
@ -84,13 +86,22 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
defer func() {
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Deployments that match those selectors.
@ -110,6 +121,23 @@ func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of Deployments
func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.DeploymentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// StatefulSetsGetter has a method to return a StatefulSetInterface.
@ -84,13 +86,22 @@ func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
defer func() {
func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of StatefulSets that match those selectors.
@ -110,6 +121,23 @@ func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of StatefulSets
func (c *statefulSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.StatefulSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested statefulSets.
func (c *statefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ControllerRevisionsGetter has a method to return a ControllerRevisionInterface.
@ -82,13 +84,22 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.G
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
defer func() {
func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
@ -108,6 +119,23 @@ func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of ControllerRevisions
func (c *controllerRevisions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.ControllerRevisionList{}
err = c.client.Get().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested controllerRevisions.
func (c *controllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DaemonSetsGetter has a method to return a DaemonSetInterface.
@ -84,13 +86,22 @@ func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) {
defer func() {
func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DaemonSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of DaemonSets that match those selectors.
@ -110,6 +121,23 @@ func (c *daemonSets) list(ctx context.Context, opts v1.ListOptions) (result *v1b
return
}
// watchList establishes a watch stream with the server and returns the list of DaemonSets
func (c *daemonSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.DaemonSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *daemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DeploymentsGetter has a method to return a DeploymentInterface.
@ -84,13 +86,22 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) {
defer func() {
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Deployments that match those selectors.
@ -110,6 +121,23 @@ func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of Deployments
func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.DeploymentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ReplicaSetsGetter has a method to return a ReplicaSetInterface.
@ -84,13 +86,22 @@ func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) {
defer func() {
func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
@ -110,6 +121,23 @@ func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of ReplicaSets
func (c *replicaSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.ReplicaSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested replicaSets.
func (c *replicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// StatefulSetsGetter has a method to return a StatefulSetInterface.
@ -88,13 +90,22 @@ func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) {
defer func() {
func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of StatefulSets that match those selectors.
@ -114,6 +125,23 @@ func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of StatefulSets
func (c *statefulSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.StatefulSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested statefulSets.
func (c *statefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@ -84,13 +86,22 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
defer func() {
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
@ -110,6 +121,23 @@ func (c *horizontalPodAutoscalers) list(ctx context.Context, opts metav1.ListOpt
return
}
// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers
func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@ -84,13 +86,22 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) {
defer func() {
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2.HorizontalPodAutoscalerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
@ -110,6 +121,23 @@ func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions
return
}
// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers
func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v2.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@ -84,13 +86,22 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) {
defer func() {
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
@ -110,6 +121,23 @@ func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions
return
}
// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers
func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v2beta1.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@ -84,13 +86,22 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) {
defer func() {
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
@ -110,6 +121,23 @@ func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions
return
}
// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers
func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v2beta2.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// CronJobsGetter has a method to return a CronJobInterface.
@ -84,13 +86,22 @@ func (c *cronJobs) Get(ctx context.Context, name string, options metav1.GetOptio
}
// List takes label and field selectors, and returns the list of CronJobs that match those selectors.
func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) {
defer func() {
func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (*v1.CronJobList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for cronjobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for cronjobs", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for cronjobs ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of CronJobs that match those selectors.
@ -110,6 +121,23 @@ func (c *cronJobs) list(ctx context.Context, opts metav1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of CronJobs
func (c *cronJobs) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.CronJobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("cronjobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested cronJobs.
func (c *cronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// JobsGetter has a method to return a JobInterface.
@ -84,13 +86,22 @@ func (c *jobs) Get(ctx context.Context, name string, options metav1.GetOptions)
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) {
defer func() {
func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for jobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for jobs", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for jobs", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for jobs ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for jobs", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Jobs that match those selectors.
@ -110,6 +121,23 @@ func (c *jobs) list(ctx context.Context, opts metav1.ListOptions) (result *v1.Jo
return
}
// watchList establishes a watch stream with the server and returns the list of Jobs
func (c *jobs) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.JobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *jobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// CronJobsGetter has a method to return a CronJobInterface.
@ -84,13 +86,22 @@ func (c *cronJobs) Get(ctx context.Context, name string, options v1.GetOptions)
}
// List takes label and field selectors, and returns the list of CronJobs that match those selectors.
func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) {
defer func() {
func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CronJobList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for cronjobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for cronjobs", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for cronjobs ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of CronJobs that match those selectors.
@ -110,6 +121,23 @@ func (c *cronJobs) list(ctx context.Context, opts v1.ListOptions) (result *v1bet
return
}
// watchList establishes a watch stream with the server and returns the list of CronJobs
func (c *cronJobs) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.CronJobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("cronjobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested cronJobs.
func (c *cronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface.
@ -83,13 +85,22 @@ func (c *certificateSigningRequests) Get(ctx context.Context, name string, optio
}
// List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors.
func (c *certificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) {
defer func() {
func (c *certificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateSigningRequestList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for certificatesigningrequests, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for certificatesigningrequests", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for certificatesigningrequests ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors.
@ -108,6 +119,22 @@ func (c *certificateSigningRequests) list(ctx context.Context, opts metav1.ListO
return
}
// watchList establishes a watch stream with the server and returns the list of CertificateSigningRequests
func (c *certificateSigningRequests) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.CertificateSigningRequestList{}
err = c.client.Get().
Resource("certificatesigningrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested certificateSigningRequests.
func (c *certificateSigningRequests) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ClusterTrustBundlesGetter has a method to return a ClusterTrustBundleInterface.
@ -79,13 +81,22 @@ func (c *clusterTrustBundles) Get(ctx context.Context, name string, options v1.G
}
// List takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors.
func (c *clusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) {
defer func() {
func (c *clusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterTrustBundleList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for clustertrustbundles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clustertrustbundles", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clustertrustbundles", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for clustertrustbundles ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clustertrustbundles", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors.
@ -104,6 +115,22 @@ func (c *clusterTrustBundles) list(ctx context.Context, opts v1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of ClusterTrustBundles
func (c *clusterTrustBundles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterTrustBundleList{}
err = c.client.Get().
Resource("clustertrustbundles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterTrustBundles.
func (c *clusterTrustBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface.
@ -81,13 +83,22 @@ func (c *certificateSigningRequests) Get(ctx context.Context, name string, optio
}
// List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors.
func (c *certificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) {
defer func() {
func (c *certificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for certificatesigningrequests, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for certificatesigningrequests", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for certificatesigningrequests ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors.
@ -106,6 +117,22 @@ func (c *certificateSigningRequests) list(ctx context.Context, opts v1.ListOptio
return
}
// watchList establishes a watch stream with the server and returns the list of CertificateSigningRequests
func (c *certificateSigningRequests) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.CertificateSigningRequestList{}
err = c.client.Get().
Resource("certificatesigningrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested certificateSigningRequests.
func (c *certificateSigningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// LeasesGetter has a method to return a LeaseInterface.
@ -82,13 +84,22 @@ func (c *leases) Get(ctx context.Context, name string, options metav1.GetOptions
}
// List takes label and field selectors, and returns the list of Leases that match those selectors.
func (c *leases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) {
defer func() {
func (c *leases) List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for leases, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for leases", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for leases ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Leases that match those selectors.
@ -108,6 +119,23 @@ func (c *leases) list(ctx context.Context, opts metav1.ListOptions) (result *v1.
return
}
// watchList establishes a watch stream with the server and returns the list of Leases
func (c *leases) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.LeaseList{}
err = c.client.Get().
Namespace(c.ns).
Resource("leases").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested leases.
func (c *leases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// LeasesGetter has a method to return a LeaseInterface.
@ -82,13 +84,22 @@ func (c *leases) Get(ctx context.Context, name string, options v1.GetOptions) (r
}
// List takes label and field selectors, and returns the list of Leases that match those selectors.
func (c *leases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) {
defer func() {
func (c *leases) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LeaseList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for leases, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for leases", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for leases ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Leases that match those selectors.
@ -108,6 +119,23 @@ func (c *leases) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1
return
}
// watchList establishes a watch stream with the server and returns the list of Leases
func (c *leases) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.LeaseList{}
err = c.client.Get().
Namespace(c.ns).
Resource("leases").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested leases.
func (c *leases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ComponentStatusesGetter has a method to return a ComponentStatusInterface.
@ -79,13 +81,22 @@ func (c *componentStatuses) Get(ctx context.Context, name string, options metav1
}
// List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors.
func (c *componentStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) {
defer func() {
func (c *componentStatuses) List(ctx context.Context, opts metav1.ListOptions) (*v1.ComponentStatusList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for componentstatuses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for componentstatuses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for componentstatuses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for componentstatuses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for componentstatuses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ComponentStatuses that match those selectors.
@ -104,6 +115,22 @@ func (c *componentStatuses) list(ctx context.Context, opts metav1.ListOptions) (
return
}
// watchList establishes a watch stream with the server and returns the list of ComponentStatuses
func (c *componentStatuses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ComponentStatusList{}
err = c.client.Get().
Resource("componentstatuses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested componentStatuses.
func (c *componentStatuses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ConfigMapsGetter has a method to return a ConfigMapInterface.
@ -82,13 +84,22 @@ func (c *configMaps) Get(ctx context.Context, name string, options metav1.GetOpt
}
// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors.
func (c *configMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) {
defer func() {
func (c *configMaps) List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for configmaps, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for configmaps", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for configmaps", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for configmaps ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for configmaps", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ConfigMaps that match those selectors.
@ -108,6 +119,23 @@ func (c *configMaps) list(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of ConfigMaps
func (c *configMaps) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ConfigMapList{}
err = c.client.Get().
Namespace(c.ns).
Resource("configmaps").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested configMaps.
func (c *configMaps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// EndpointsGetter has a method to return a EndpointsInterface.
@ -82,13 +84,22 @@ func (c *endpoints) Get(ctx context.Context, name string, options metav1.GetOpti
}
// List takes label and field selectors, and returns the list of Endpoints that match those selectors.
func (c *endpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) {
defer func() {
func (c *endpoints) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for endpoints, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpoints", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpoints", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for endpoints ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpoints", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Endpoints that match those selectors.
@ -108,6 +119,23 @@ func (c *endpoints) list(ctx context.Context, opts metav1.ListOptions) (result *
return
}
// watchList establishes a watch stream with the server and returns the list of Endpoints
func (c *endpoints) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.EndpointsList{}
err = c.client.Get().
Namespace(c.ns).
Resource("endpoints").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested endpoints.
func (c *endpoints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// EventsGetter has a method to return a EventInterface.
@ -82,13 +84,22 @@ func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions
}
// List takes label and field selectors, and returns the list of Events that match those selectors.
func (c *events) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) {
defer func() {
func (c *events) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Events that match those selectors.
@ -108,6 +119,23 @@ func (c *events) list(ctx context.Context, opts metav1.ListOptions) (result *v1.
return
}
// watchList establishes a watch stream with the server and returns the list of Events
func (c *events) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.EventList{}
err = c.client.Get().
Namespace(c.ns).
Resource("events").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested events.
func (c *events) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// LimitRangesGetter has a method to return a LimitRangeInterface.
@ -82,13 +84,22 @@ func (c *limitRanges) Get(ctx context.Context, name string, options metav1.GetOp
}
// List takes label and field selectors, and returns the list of LimitRanges that match those selectors.
func (c *limitRanges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) {
defer func() {
func (c *limitRanges) List(ctx context.Context, opts metav1.ListOptions) (*v1.LimitRangeList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for limitranges, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for limitranges", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for limitranges", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for limitranges ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for limitranges", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of LimitRanges that match those selectors.
@ -108,6 +119,23 @@ func (c *limitRanges) list(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of LimitRanges
func (c *limitRanges) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.LimitRangeList{}
err = c.client.Get().
Namespace(c.ns).
Resource("limitranges").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested limitRanges.
func (c *limitRanges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// NamespacesGetter has a method to return a NamespaceInterface.
@ -80,13 +82,22 @@ func (c *namespaces) Get(ctx context.Context, name string, options metav1.GetOpt
}
// List takes label and field selectors, and returns the list of Namespaces that match those selectors.
func (c *namespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) {
defer func() {
func (c *namespaces) List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for namespaces, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for namespaces", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for namespaces", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for namespaces ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for namespaces", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Namespaces that match those selectors.
@ -105,6 +116,22 @@ func (c *namespaces) list(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of Namespaces
func (c *namespaces) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.NamespaceList{}
err = c.client.Get().
Resource("namespaces").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested namespaces.
func (c *namespaces) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// NodesGetter has a method to return a NodeInterface.
@ -81,13 +83,22 @@ func (c *nodes) Get(ctx context.Context, name string, options metav1.GetOptions)
}
// List takes label and field selectors, and returns the list of Nodes that match those selectors.
func (c *nodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) {
defer func() {
func (c *nodes) List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for nodes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for nodes", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for nodes", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for nodes ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for nodes", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Nodes that match those selectors.
@ -106,6 +117,22 @@ func (c *nodes) list(ctx context.Context, opts metav1.ListOptions) (result *v1.N
return
}
// watchList establishes a watch stream with the server and returns the list of Nodes
func (c *nodes) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.NodeList{}
err = c.client.Get().
Resource("nodes").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested nodes.
func (c *nodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PersistentVolumesGetter has a method to return a PersistentVolumeInterface.
@ -81,13 +83,22 @@ func (c *persistentVolumes) Get(ctx context.Context, name string, options metav1
}
// List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors.
func (c *persistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) {
defer func() {
func (c *persistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for persistentvolumes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumes", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for persistentvolumes", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for persistentvolumes ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumes", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PersistentVolumes that match those selectors.
@ -106,6 +117,22 @@ func (c *persistentVolumes) list(ctx context.Context, opts metav1.ListOptions) (
return
}
// watchList establishes a watch stream with the server and returns the list of PersistentVolumes
func (c *persistentVolumes) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PersistentVolumeList{}
err = c.client.Get().
Resource("persistentvolumes").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested persistentVolumes.
func (c *persistentVolumes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface.
@ -84,13 +86,22 @@ func (c *persistentVolumeClaims) Get(ctx context.Context, name string, options m
}
// List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors.
func (c *persistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) {
defer func() {
func (c *persistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeClaimList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for persistentvolumeclaims, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumeclaims", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for persistentvolumeclaims", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for persistentvolumeclaims ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumeclaims", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors.
@ -110,6 +121,23 @@ func (c *persistentVolumeClaims) list(ctx context.Context, opts metav1.ListOptio
return
}
// watchList establishes a watch stream with the server and returns the list of PersistentVolumeClaims
func (c *persistentVolumeClaims) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PersistentVolumeClaimList{}
err = c.client.Get().
Namespace(c.ns).
Resource("persistentvolumeclaims").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested persistentVolumeClaims.
func (c *persistentVolumeClaims) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PodsGetter has a method to return a PodInterface.
@ -86,13 +88,22 @@ func (c *pods) Get(ctx context.Context, name string, options metav1.GetOptions)
}
// List takes label and field selectors, and returns the list of Pods that match those selectors.
func (c *pods) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) {
defer func() {
func (c *pods) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for pods, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for pods", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for pods", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for pods ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for pods", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Pods that match those selectors.
@ -112,6 +123,23 @@ func (c *pods) list(ctx context.Context, opts metav1.ListOptions) (result *v1.Po
return
}
// watchList establishes a watch stream with the server and returns the list of Pods
func (c *pods) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PodList{}
err = c.client.Get().
Namespace(c.ns).
Resource("pods").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested pods.
func (c *pods) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PodTemplatesGetter has a method to return a PodTemplateInterface.
@ -82,13 +84,22 @@ func (c *podTemplates) Get(ctx context.Context, name string, options metav1.GetO
}
// List takes label and field selectors, and returns the list of PodTemplates that match those selectors.
func (c *podTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) {
defer func() {
func (c *podTemplates) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodTemplateList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for podtemplates, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podtemplates", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for podtemplates", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for podtemplates ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podtemplates", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PodTemplates that match those selectors.
@ -108,6 +119,23 @@ func (c *podTemplates) list(ctx context.Context, opts metav1.ListOptions) (resul
return
}
// watchList establishes a watch stream with the server and returns the list of PodTemplates
func (c *podTemplates) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PodTemplateList{}
err = c.client.Get().
Namespace(c.ns).
Resource("podtemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested podTemplates.
func (c *podTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -33,6 +33,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ReplicationControllersGetter has a method to return a ReplicationControllerInterface.
@ -88,13 +90,22 @@ func (c *replicationControllers) Get(ctx context.Context, name string, options m
}
// List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors.
func (c *replicationControllers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) {
defer func() {
func (c *replicationControllers) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicationControllerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for replicationcontrollers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicationcontrollers", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicationcontrollers", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for replicationcontrollers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicationcontrollers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ReplicationControllers that match those selectors.
@ -114,6 +125,23 @@ func (c *replicationControllers) list(ctx context.Context, opts metav1.ListOptio
return
}
// watchList establishes a watch stream with the server and returns the list of ReplicationControllers
func (c *replicationControllers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ReplicationControllerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicationcontrollers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested replicationControllers.
func (c *replicationControllers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ResourceQuotasGetter has a method to return a ResourceQuotaInterface.
@ -84,13 +86,22 @@ func (c *resourceQuotas) Get(ctx context.Context, name string, options metav1.Ge
}
// List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors.
func (c *resourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) {
defer func() {
func (c *resourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceQuotaList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for resourcequotas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourcequotas", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourcequotas", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for resourcequotas ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourcequotas", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ResourceQuotas that match those selectors.
@ -110,6 +121,23 @@ func (c *resourceQuotas) list(ctx context.Context, opts metav1.ListOptions) (res
return
}
// watchList establishes a watch stream with the server and returns the list of ResourceQuotas
func (c *resourceQuotas) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ResourceQuotaList{}
err = c.client.Get().
Namespace(c.ns).
Resource("resourcequotas").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested resourceQuotas.
func (c *resourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// SecretsGetter has a method to return a SecretInterface.
@ -82,13 +84,22 @@ func (c *secrets) Get(ctx context.Context, name string, options metav1.GetOption
}
// List takes label and field selectors, and returns the list of Secrets that match those selectors.
func (c *secrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) {
defer func() {
func (c *secrets) List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for secrets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for secrets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for secrets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for secrets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for secrets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Secrets that match those selectors.
@ -108,6 +119,23 @@ func (c *secrets) list(ctx context.Context, opts metav1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of Secrets
func (c *secrets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.SecretList{}
err = c.client.Get().
Namespace(c.ns).
Resource("secrets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested secrets.
func (c *secrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ServicesGetter has a method to return a ServiceInterface.
@ -83,13 +85,22 @@ func (c *services) Get(ctx context.Context, name string, options metav1.GetOptio
}
// List takes label and field selectors, and returns the list of Services that match those selectors.
func (c *services) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) {
defer func() {
func (c *services) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for services, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for services", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for services", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for services ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for services", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Services that match those selectors.
@ -109,6 +120,23 @@ func (c *services) list(ctx context.Context, opts metav1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of Services
func (c *services) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ServiceList{}
err = c.client.Get().
Namespace(c.ns).
Resource("services").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested services.
func (c *services) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -33,6 +33,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ServiceAccountsGetter has a method to return a ServiceAccountInterface.
@ -85,13 +87,22 @@ func (c *serviceAccounts) Get(ctx context.Context, name string, options metav1.G
}
// List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors.
func (c *serviceAccounts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) {
defer func() {
func (c *serviceAccounts) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceAccountList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for serviceaccounts, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for serviceaccounts", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for serviceaccounts", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for serviceaccounts ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for serviceaccounts", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ServiceAccounts that match those selectors.
@ -111,6 +122,23 @@ func (c *serviceAccounts) list(ctx context.Context, opts metav1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of ServiceAccounts
func (c *serviceAccounts) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ServiceAccountList{}
err = c.client.Get().
Namespace(c.ns).
Resource("serviceaccounts").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested serviceAccounts.
func (c *serviceAccounts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// EndpointSlicesGetter has a method to return a EndpointSliceInterface.
@ -82,13 +84,22 @@ func (c *endpointSlices) Get(ctx context.Context, name string, options metav1.Ge
}
// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors.
func (c *endpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) {
defer func() {
func (c *endpointSlices) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointSliceList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for endpointslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpointslices", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for endpointslices ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of EndpointSlices that match those selectors.
@ -108,6 +119,23 @@ func (c *endpointSlices) list(ctx context.Context, opts metav1.ListOptions) (res
return
}
// watchList establishes a watch stream with the server and returns the list of EndpointSlices
func (c *endpointSlices) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.EndpointSliceList{}
err = c.client.Get().
Namespace(c.ns).
Resource("endpointslices").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested endpointSlices.
func (c *endpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// EndpointSlicesGetter has a method to return a EndpointSliceInterface.
@ -82,13 +84,22 @@ func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOpt
}
// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors.
func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) {
defer func() {
func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for endpointslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpointslices", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for endpointslices ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of EndpointSlices that match those selectors.
@ -108,6 +119,23 @@ func (c *endpointSlices) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of EndpointSlices
func (c *endpointSlices) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.EndpointSliceList{}
err = c.client.Get().
Namespace(c.ns).
Resource("endpointslices").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested endpointSlices.
func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// EventsGetter has a method to return a EventInterface.
@ -82,13 +84,22 @@ func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions
}
// List takes label and field selectors, and returns the list of Events that match those selectors.
func (c *events) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) {
defer func() {
func (c *events) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Events that match those selectors.
@ -108,6 +119,23 @@ func (c *events) list(ctx context.Context, opts metav1.ListOptions) (result *v1.
return
}
// watchList establishes a watch stream with the server and returns the list of Events
func (c *events) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.EventList{}
err = c.client.Get().
Namespace(c.ns).
Resource("events").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested events.
func (c *events) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// EventsGetter has a method to return a EventInterface.
@ -82,13 +84,22 @@ func (c *events) Get(ctx context.Context, name string, options v1.GetOptions) (r
}
// List takes label and field selectors, and returns the list of Events that match those selectors.
func (c *events) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) {
defer func() {
func (c *events) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EventList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Events that match those selectors.
@ -108,6 +119,23 @@ func (c *events) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1
return
}
// watchList establishes a watch stream with the server and returns the list of Events
func (c *events) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.EventList{}
err = c.client.Get().
Namespace(c.ns).
Resource("events").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested events.
func (c *events) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DaemonSetsGetter has a method to return a DaemonSetInterface.
@ -84,13 +86,22 @@ func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) {
defer func() {
func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of DaemonSets that match those selectors.
@ -110,6 +121,23 @@ func (c *daemonSets) list(ctx context.Context, opts v1.ListOptions) (result *v1b
return
}
// watchList establishes a watch stream with the server and returns the list of DaemonSets
func (c *daemonSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.DaemonSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *daemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DeploymentsGetter has a method to return a DeploymentInterface.
@ -88,13 +90,22 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
defer func() {
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Deployments that match those selectors.
@ -114,6 +125,23 @@ func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of Deployments
func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.DeploymentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// IngressesGetter has a method to return a IngressInterface.
@ -84,13 +86,22 @@ func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions)
}
// List takes label and field selectors, and returns the list of Ingresses that match those selectors.
func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) {
defer func() {
func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Ingresses that match those selectors.
@ -110,6 +121,23 @@ func (c *ingresses) list(ctx context.Context, opts v1.ListOptions) (result *v1be
return
}
// watchList establishes a watch stream with the server and returns the list of Ingresses
func (c *ingresses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.IngressList{}
err = c.client.Get().
Namespace(c.ns).
Resource("ingresses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *ingresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// NetworkPoliciesGetter has a method to return a NetworkPolicyInterface.
@ -82,13 +84,22 @@ func (c *networkPolicies) Get(ctx context.Context, name string, options v1.GetOp
}
// List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors.
func (c *networkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) {
defer func() {
func (c *networkPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.NetworkPolicyList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for networkpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for networkpolicies", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for networkpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of NetworkPolicies that match those selectors.
@ -108,6 +119,23 @@ func (c *networkPolicies) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of NetworkPolicies
func (c *networkPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.NetworkPolicyList{}
err = c.client.Get().
Namespace(c.ns).
Resource("networkpolicies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested networkPolicies.
func (c *networkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ReplicaSetsGetter has a method to return a ReplicaSetInterface.
@ -88,13 +90,22 @@ func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) {
defer func() {
func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
@ -114,6 +125,23 @@ func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of ReplicaSets
func (c *replicaSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ReplicaSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested replicaSets.
func (c *replicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// FlowSchemasGetter has a method to return a FlowSchemaInterface.
@ -81,13 +83,22 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options metav1.GetOp
}
// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) {
defer func() {
func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (*v1.FlowSchemaList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
@ -106,6 +117,22 @@ func (c *flowSchemas) list(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of FlowSchemas
func (c *flowSchemas) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.FlowSchemaList{}
err = c.client.Get().
Resource("flowschemas").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested flowSchemas.
func (c *flowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface.
@ -81,13 +83,22 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) {
defer func() {
func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityLevelConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
@ -106,6 +117,22 @@ func (c *priorityLevelConfigurations) list(ctx context.Context, opts metav1.List
return
}
// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations
func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PriorityLevelConfigurationList{}
err = c.client.Get().
Resource("prioritylevelconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations.
func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// FlowSchemasGetter has a method to return a FlowSchemaInterface.
@ -81,13 +83,22 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) {
defer func() {
func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.FlowSchemaList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
@ -106,6 +117,22 @@ func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of FlowSchemas
func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.FlowSchemaList{}
err = c.client.Get().
Resource("flowschemas").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested flowSchemas.
func (c *flowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface.
@ -81,13 +83,22 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) {
defer func() {
func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityLevelConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
@ -106,6 +117,22 @@ func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOpti
return
}
// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations
func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.PriorityLevelConfigurationList{}
err = c.client.Get().
Resource("prioritylevelconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations.
func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// FlowSchemasGetter has a method to return a FlowSchemaInterface.
@ -81,13 +83,22 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) {
defer func() {
func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.FlowSchemaList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
@ -106,6 +117,22 @@ func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of FlowSchemas
func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.FlowSchemaList{}
err = c.client.Get().
Resource("flowschemas").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested flowSchemas.
func (c *flowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface.
@ -81,13 +83,22 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) {
defer func() {
func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.PriorityLevelConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
@ -106,6 +117,22 @@ func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOpti
return
}
// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations
func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.PriorityLevelConfigurationList{}
err = c.client.Get().
Resource("prioritylevelconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations.
func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// FlowSchemasGetter has a method to return a FlowSchemaInterface.
@ -81,13 +83,22 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) {
defer func() {
func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta3.FlowSchemaList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors.
@ -106,6 +117,22 @@ func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of FlowSchemas
func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta3.FlowSchemaList{}
err = c.client.Get().
Resource("flowschemas").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested flowSchemas.
func (c *flowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface.
@ -81,13 +83,22 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) {
defer func() {
func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta3.PriorityLevelConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors.
@ -106,6 +117,22 @@ func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOpti
return
}
// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations
func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta3.PriorityLevelConfigurationList{}
err = c.client.Get().
Resource("prioritylevelconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations.
func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// IngressesGetter has a method to return a IngressInterface.
@ -84,13 +86,22 @@ func (c *ingresses) Get(ctx context.Context, name string, options metav1.GetOpti
}
// List takes label and field selectors, and returns the list of Ingresses that match those selectors.
func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) {
defer func() {
func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Ingresses that match those selectors.
@ -110,6 +121,23 @@ func (c *ingresses) list(ctx context.Context, opts metav1.ListOptions) (result *
return
}
// watchList establishes a watch stream with the server and returns the list of Ingresses
func (c *ingresses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.IngressList{}
err = c.client.Get().
Namespace(c.ns).
Resource("ingresses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *ingresses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// IngressClassesGetter has a method to return a IngressClassInterface.
@ -79,13 +81,22 @@ func (c *ingressClasses) Get(ctx context.Context, name string, options metav1.Ge
}
// List takes label and field selectors, and returns the list of IngressClasses that match those selectors.
func (c *ingressClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) {
defer func() {
func (c *ingressClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressClassList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for ingressclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingressclasses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for ingressclasses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of IngressClasses that match those selectors.
@ -104,6 +115,22 @@ func (c *ingressClasses) list(ctx context.Context, opts metav1.ListOptions) (res
return
}
// watchList establishes a watch stream with the server and returns the list of IngressClasses
func (c *ingressClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.IngressClassList{}
err = c.client.Get().
Resource("ingressclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested ingressClasses.
func (c *ingressClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// NetworkPoliciesGetter has a method to return a NetworkPolicyInterface.
@ -82,13 +84,22 @@ func (c *networkPolicies) Get(ctx context.Context, name string, options metav1.G
}
// List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors.
func (c *networkPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) {
defer func() {
func (c *networkPolicies) List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkPolicyList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for networkpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for networkpolicies", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for networkpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of NetworkPolicies that match those selectors.
@ -108,6 +119,23 @@ func (c *networkPolicies) list(ctx context.Context, opts metav1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of NetworkPolicies
func (c *networkPolicies) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.NetworkPolicyList{}
err = c.client.Get().
Namespace(c.ns).
Resource("networkpolicies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested networkPolicies.
func (c *networkPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// IPAddressesGetter has a method to return a IPAddressInterface.
@ -79,13 +81,22 @@ func (c *iPAddresses) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of IPAddresses that match those selectors.
func (c *iPAddresses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IPAddressList, err error) {
defer func() {
func (c *iPAddresses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.IPAddressList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for ipaddresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ipaddresses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ipaddresses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for ipaddresses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ipaddresses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of IPAddresses that match those selectors.
@ -104,6 +115,22 @@ func (c *iPAddresses) list(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of IPAddresses
func (c *iPAddresses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IPAddressList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.IPAddressList{}
err = c.client.Get().
Resource("ipaddresses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested iPAddresses.
func (c *iPAddresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ServiceCIDRsGetter has a method to return a ServiceCIDRInterface.
@ -81,13 +83,22 @@ func (c *serviceCIDRs) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors.
func (c *serviceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) {
defer func() {
func (c *serviceCIDRs) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ServiceCIDRList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for servicecidrs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for servicecidrs", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for servicecidrs", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for servicecidrs ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for servicecidrs", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors.
@ -106,6 +117,22 @@ func (c *serviceCIDRs) list(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of ServiceCIDRs
func (c *serviceCIDRs) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ServiceCIDRList{}
err = c.client.Get().
Resource("servicecidrs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested serviceCIDRs.
func (c *serviceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// IngressesGetter has a method to return a IngressInterface.
@ -84,13 +86,22 @@ func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions)
}
// List takes label and field selectors, and returns the list of Ingresses that match those selectors.
func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) {
defer func() {
func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Ingresses that match those selectors.
@ -110,6 +121,23 @@ func (c *ingresses) list(ctx context.Context, opts v1.ListOptions) (result *v1be
return
}
// watchList establishes a watch stream with the server and returns the list of Ingresses
func (c *ingresses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.IngressList{}
err = c.client.Get().
Namespace(c.ns).
Resource("ingresses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *ingresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// IngressClassesGetter has a method to return a IngressClassInterface.
@ -79,13 +81,22 @@ func (c *ingressClasses) Get(ctx context.Context, name string, options v1.GetOpt
}
// List takes label and field selectors, and returns the list of IngressClasses that match those selectors.
func (c *ingressClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) {
defer func() {
func (c *ingressClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressClassList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for ingressclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingressclasses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for ingressclasses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of IngressClasses that match those selectors.
@ -104,6 +115,22 @@ func (c *ingressClasses) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of IngressClasses
func (c *ingressClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.IngressClassList{}
err = c.client.Get().
Resource("ingressclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested ingressClasses.
func (c *ingressClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RuntimeClassesGetter has a method to return a RuntimeClassInterface.
@ -79,13 +81,22 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options metav1.Ge
}
// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
func (c *runtimeClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) {
defer func() {
func (c *runtimeClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.RuntimeClassList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
@ -104,6 +115,22 @@ func (c *runtimeClasses) list(ctx context.Context, opts metav1.ListOptions) (res
return
}
// watchList establishes a watch stream with the server and returns the list of RuntimeClasses
func (c *runtimeClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.RuntimeClassList{}
err = c.client.Get().
Resource("runtimeclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested runtimeClasses.
func (c *runtimeClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RuntimeClassesGetter has a method to return a RuntimeClassInterface.
@ -79,13 +81,22 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOpt
}
// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) {
defer func() {
func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RuntimeClassList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
@ -104,6 +115,22 @@ func (c *runtimeClasses) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of RuntimeClasses
func (c *runtimeClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.RuntimeClassList{}
err = c.client.Get().
Resource("runtimeclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested runtimeClasses.
func (c *runtimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RuntimeClassesGetter has a method to return a RuntimeClassInterface.
@ -79,13 +81,22 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOpt
}
// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) {
defer func() {
func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RuntimeClassList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors.
@ -104,6 +115,22 @@ func (c *runtimeClasses) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of RuntimeClasses
func (c *runtimeClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.RuntimeClassList{}
err = c.client.Get().
Resource("runtimeclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested runtimeClasses.
func (c *runtimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface.
@ -84,13 +86,22 @@ func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options met
}
// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors.
func (c *podDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) {
defer func() {
func (c *podDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodDisruptionBudgetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for poddisruptionbudgets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for poddisruptionbudgets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for poddisruptionbudgets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors.
@ -110,6 +121,23 @@ func (c *podDisruptionBudgets) list(ctx context.Context, opts metav1.ListOptions
return
}
// watchList establishes a watch stream with the server and returns the list of PodDisruptionBudgets
func (c *podDisruptionBudgets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PodDisruptionBudgetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("poddisruptionbudgets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested podDisruptionBudgets.
func (c *podDisruptionBudgets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface.
@ -84,13 +86,22 @@ func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options v1.
}
// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors.
func (c *podDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) {
defer func() {
func (c *podDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for poddisruptionbudgets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for poddisruptionbudgets", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for poddisruptionbudgets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors.
@ -110,6 +121,23 @@ func (c *podDisruptionBudgets) list(ctx context.Context, opts v1.ListOptions) (r
return
}
// watchList establishes a watch stream with the server and returns the list of PodDisruptionBudgets
func (c *podDisruptionBudgets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.PodDisruptionBudgetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("poddisruptionbudgets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested podDisruptionBudgets.
func (c *podDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ClusterRolesGetter has a method to return a ClusterRoleInterface.
@ -79,13 +81,22 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options metav1.GetO
}
// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors.
func (c *clusterRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) {
defer func() {
func (c *clusterRoles) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors.
@ -104,6 +115,22 @@ func (c *clusterRoles) list(ctx context.Context, opts metav1.ListOptions) (resul
return
}
// watchList establishes a watch stream with the server and returns the list of ClusterRoles
func (c *clusterRoles) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ClusterRoleList{}
err = c.client.Get().
Resource("clusterroles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterRoles.
func (c *clusterRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface.
@ -79,13 +81,22 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options meta
}
// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors.
func (c *clusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) {
defer func() {
func (c *clusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors.
@ -104,6 +115,22 @@ func (c *clusterRoleBindings) list(ctx context.Context, opts metav1.ListOptions)
return
}
// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings
func (c *clusterRoleBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ClusterRoleBindingList{}
err = c.client.Get().
Resource("clusterrolebindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterRoleBindings.
func (c *clusterRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RolesGetter has a method to return a RoleInterface.
@ -82,13 +84,22 @@ func (c *roles) Get(ctx context.Context, name string, options metav1.GetOptions)
}
// List takes label and field selectors, and returns the list of Roles that match those selectors.
func (c *roles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) {
defer func() {
func (c *roles) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Roles that match those selectors.
@ -108,6 +119,23 @@ func (c *roles) list(ctx context.Context, opts metav1.ListOptions) (result *v1.R
return
}
// watchList establishes a watch stream with the server and returns the list of Roles
func (c *roles) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.RoleList{}
err = c.client.Get().
Namespace(c.ns).
Resource("roles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested roles.
func (c *roles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RoleBindingsGetter has a method to return a RoleBindingInterface.
@ -82,13 +84,22 @@ func (c *roleBindings) Get(ctx context.Context, name string, options metav1.GetO
}
// List takes label and field selectors, and returns the list of RoleBindings that match those selectors.
func (c *roleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) {
defer func() {
func (c *roleBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of RoleBindings that match those selectors.
@ -108,6 +119,23 @@ func (c *roleBindings) list(ctx context.Context, opts metav1.ListOptions) (resul
return
}
// watchList establishes a watch stream with the server and returns the list of RoleBindings
func (c *roleBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.RoleBindingList{}
err = c.client.Get().
Namespace(c.ns).
Resource("rolebindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested roleBindings.
func (c *roleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ClusterRolesGetter has a method to return a ClusterRoleInterface.
@ -79,13 +81,22 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors.
func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) {
defer func() {
func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors.
@ -104,6 +115,22 @@ func (c *clusterRoles) list(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of ClusterRoles
func (c *clusterRoles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterRoleList{}
err = c.client.Get().
Resource("clusterroles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterRoles.
func (c *clusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface.
@ -79,13 +81,22 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.G
}
// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors.
func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) {
defer func() {
func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors.
@ -104,6 +115,22 @@ func (c *clusterRoleBindings) list(ctx context.Context, opts v1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings
func (c *clusterRoleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ClusterRoleBindingList{}
err = c.client.Get().
Resource("clusterrolebindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterRoleBindings.
func (c *clusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RolesGetter has a method to return a RoleInterface.
@ -82,13 +84,22 @@ func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (re
}
// List takes label and field selectors, and returns the list of Roles that match those selectors.
func (c *roles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) {
defer func() {
func (c *roles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Roles that match those selectors.
@ -108,6 +119,23 @@ func (c *roles) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1
return
}
// watchList establishes a watch stream with the server and returns the list of Roles
func (c *roles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.RoleList{}
err = c.client.Get().
Namespace(c.ns).
Resource("roles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested roles.
func (c *roles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RoleBindingsGetter has a method to return a RoleBindingInterface.
@ -82,13 +84,22 @@ func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of RoleBindings that match those selectors.
func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) {
defer func() {
func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of RoleBindings that match those selectors.
@ -108,6 +119,23 @@ func (c *roleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of RoleBindings
func (c *roleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.RoleBindingList{}
err = c.client.Get().
Namespace(c.ns).
Resource("rolebindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested roleBindings.
func (c *roleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ClusterRolesGetter has a method to return a ClusterRoleInterface.
@ -79,13 +81,22 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors.
func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) {
defer func() {
func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors.
@ -104,6 +115,22 @@ func (c *clusterRoles) list(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of ClusterRoles
func (c *clusterRoles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ClusterRoleList{}
err = c.client.Get().
Resource("clusterroles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterRoles.
func (c *clusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface.
@ -79,13 +81,22 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.G
}
// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors.
func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) {
defer func() {
func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors.
@ -104,6 +115,22 @@ func (c *clusterRoleBindings) list(ctx context.Context, opts v1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings
func (c *clusterRoleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ClusterRoleBindingList{}
err = c.client.Get().
Resource("clusterrolebindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested clusterRoleBindings.
func (c *clusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RolesGetter has a method to return a RoleInterface.
@ -82,13 +84,22 @@ func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (re
}
// List takes label and field selectors, and returns the list of Roles that match those selectors.
func (c *roles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) {
defer func() {
func (c *roles) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Roles that match those selectors.
@ -108,6 +119,23 @@ func (c *roles) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.
return
}
// watchList establishes a watch stream with the server and returns the list of Roles
func (c *roles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.RoleList{}
err = c.client.Get().
Namespace(c.ns).
Resource("roles").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested roles.
func (c *roles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// RoleBindingsGetter has a method to return a RoleBindingInterface.
@ -82,13 +84,22 @@ func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of RoleBindings that match those selectors.
func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) {
defer func() {
func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of RoleBindings that match those selectors.
@ -108,6 +119,23 @@ func (c *roleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of RoleBindings
func (c *roleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.RoleBindingList{}
err = c.client.Get().
Namespace(c.ns).
Resource("rolebindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested roleBindings.
func (c *roleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// PodSchedulingContextsGetter has a method to return a PodSchedulingContextInterface.
@ -84,13 +86,22 @@ func (c *podSchedulingContexts) Get(ctx context.Context, name string, options v1
}
// List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors.
func (c *podSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) {
defer func() {
func (c *podSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.PodSchedulingContextList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for podschedulingcontexts, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podschedulingcontexts", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for podschedulingcontexts", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for podschedulingcontexts ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podschedulingcontexts", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors.
@ -110,6 +121,23 @@ func (c *podSchedulingContexts) list(ctx context.Context, opts v1.ListOptions) (
return
}
// watchList establishes a watch stream with the server and returns the list of PodSchedulingContexts
func (c *podSchedulingContexts) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha2.PodSchedulingContextList{}
err = c.client.Get().
Namespace(c.ns).
Resource("podschedulingcontexts").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested podSchedulingContexts.
func (c *podSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ResourceClaimsGetter has a method to return a ResourceClaimInterface.
@ -84,13 +86,22 @@ func (c *resourceClaims) Get(ctx context.Context, name string, options v1.GetOpt
}
// List takes label and field selectors, and returns the list of ResourceClaims that match those selectors.
func (c *resourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) {
defer func() {
func (c *resourceClaims) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for resourceclaims, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaims", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaims", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for resourceclaims ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaims", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ResourceClaims that match those selectors.
@ -110,6 +121,23 @@ func (c *resourceClaims) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of ResourceClaims
func (c *resourceClaims) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha2.ResourceClaimList{}
err = c.client.Get().
Namespace(c.ns).
Resource("resourceclaims").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested resourceClaims.
func (c *resourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ResourceClaimParametersGetter has a method to return a ResourceClaimParametersInterface.
@ -82,13 +84,22 @@ func (c *resourceClaimParameters) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors.
func (c *resourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) {
defer func() {
func (c *resourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimParametersList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for resourceclaimparameters, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimparameters", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaimparameters", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for resourceclaimparameters ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimparameters", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors.
@ -108,6 +119,23 @@ func (c *resourceClaimParameters) list(ctx context.Context, opts v1.ListOptions)
return
}
// watchList establishes a watch stream with the server and returns the list of ResourceClaimParameters
func (c *resourceClaimParameters) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha2.ResourceClaimParametersList{}
err = c.client.Get().
Namespace(c.ns).
Resource("resourceclaimparameters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested resourceClaimParameters.
func (c *resourceClaimParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ResourceClaimTemplatesGetter has a method to return a ResourceClaimTemplateInterface.
@ -82,13 +84,22 @@ func (c *resourceClaimTemplates) Get(ctx context.Context, name string, options v
}
// List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors.
func (c *resourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) {
defer func() {
func (c *resourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimTemplateList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for resourceclaimtemplates, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimtemplates", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaimtemplates", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for resourceclaimtemplates ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimtemplates", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors.
@ -108,6 +119,23 @@ func (c *resourceClaimTemplates) list(ctx context.Context, opts v1.ListOptions)
return
}
// watchList establishes a watch stream with the server and returns the list of ResourceClaimTemplates
func (c *resourceClaimTemplates) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha2.ResourceClaimTemplateList{}
err = c.client.Get().
Namespace(c.ns).
Resource("resourceclaimtemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested resourceClaimTemplates.
func (c *resourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ResourceClassesGetter has a method to return a ResourceClassInterface.
@ -79,13 +81,22 @@ func (c *resourceClasses) Get(ctx context.Context, name string, options v1.GetOp
}
// List takes label and field selectors, and returns the list of ResourceClasses that match those selectors.
func (c *resourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) {
defer func() {
func (c *resourceClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for resourceclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclasses", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclasses", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for resourceclasses ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclasses", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ResourceClasses that match those selectors.
@ -104,6 +115,22 @@ func (c *resourceClasses) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of ResourceClasses
func (c *resourceClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha2.ResourceClassList{}
err = c.client.Get().
Resource("resourceclasses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested resourceClasses.
func (c *resourceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ResourceClassParametersGetter has a method to return a ResourceClassParametersInterface.
@ -82,13 +84,22 @@ func (c *resourceClassParameters) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors.
func (c *resourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) {
defer func() {
func (c *resourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassParametersList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for resourceclassparameters, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclassparameters", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclassparameters", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for resourceclassparameters ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclassparameters", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors.
@ -108,6 +119,23 @@ func (c *resourceClassParameters) list(ctx context.Context, opts v1.ListOptions)
return
}
// watchList establishes a watch stream with the server and returns the list of ResourceClassParameters
func (c *resourceClassParameters) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha2.ResourceClassParametersList{}
err = c.client.Get().
Namespace(c.ns).
Resource("resourceclassparameters").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested resourceClassParameters.
func (c *resourceClassParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@ -32,6 +32,8 @@ import (
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ResourceSlicesGetter has a method to return a ResourceSliceInterface.
@ -79,13 +81,22 @@ func (c *resourceSlices) Get(ctx context.Context, name string, options v1.GetOpt
}
// List takes label and field selectors, and returns the list of ResourceSlices that match those selectors.
func (c *resourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) {
defer func() {
func (c *resourceSlices) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceSliceList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for resourceslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceslices", c.list, opts, result)
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceslices", c.list, opts, result)
return result, nil
}
}()
return c.list(ctx, opts)
klog.Warningf("The watchlist request for resourceslices ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceslices", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ResourceSlices that match those selectors.
@ -104,6 +115,22 @@ func (c *resourceSlices) list(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of ResourceSlices
func (c *resourceSlices) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha2.ResourceSliceList{}
err = c.client.Get().
Resource("resourceslices").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested resourceSlices.
func (c *resourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

Some files were not shown because too many files have changed in this diff Show More