diff --git a/admissionregistration/v1/mutatingwebhookconfiguration.go b/admissionregistration/v1/mutatingwebhookconfiguration.go index c8df7f832..c7afdb89e 100644 --- a/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -121,11 +121,11 @@ func UpdateMutatingWebhookCABundle(config *rest.Config, webhookConfigName string kc := kubernetes.NewForConfigOrDie(config) lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1().MutatingWebhookConfigurations().List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(ctx, options) }, @@ -177,11 +177,11 @@ func SyncMutatingWebhookCABundle(config *rest.Config, webhookConfigName string) kc := kubernetes.NewForConfigOrDie(config) lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1().MutatingWebhookConfigurations().List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(ctx, options) }, diff --git a/admissionregistration/v1/validatingwebhookconfiguration.go b/admissionregistration/v1/validatingwebhookconfiguration.go index bf18cf16f..e9a21f5f0 100644 --- a/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/admissionregistration/v1/validatingwebhookconfiguration.go @@ -121,11 +121,11 @@ func UpdateValidatingWebhookCABundle(config *rest.Config, webhookConfigName stri kc := kubernetes.NewForConfigOrDie(config) lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(ctx, options) }, @@ -177,11 +177,11 @@ func SyncValidatingWebhookCABundle(config *rest.Config, webhookConfigName string kc := kubernetes.NewForConfigOrDie(config) lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(ctx, options) }, diff --git a/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 943052612..243cd71e5 100644 --- a/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -121,11 +121,11 @@ func UpdateMutatingWebhookCABundle(config *rest.Config, webhookConfigName string kc := kubernetes.NewForConfigOrDie(config) lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(ctx, options) }, @@ -177,11 +177,11 @@ func SyncMutatingWebhookCABundle(config *rest.Config, webhookConfigName string) kc := kubernetes.NewForConfigOrDie(config) lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(ctx, options) }, diff --git a/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 3283ae7f3..92e59d32b 100644 --- a/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -121,11 +121,11 @@ func UpdateValidatingWebhookCABundle(config *rest.Config, webhookConfigName stri kc := kubernetes.NewForConfigOrDie(config) lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(ctx, options) }, @@ -177,11 +177,11 @@ func SyncValidatingWebhookCABundle(config *rest.Config, webhookConfigName string kc := kubernetes.NewForConfigOrDie(config) lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, webhookConfigName).String() return kc.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(ctx, options) }, diff --git a/dynamic/kubernetes.go b/dynamic/kubernetes.go index 6be3a2113..ca719f194 100644 --- a/dynamic/kubernetes.go +++ b/dynamic/kubernetes.go @@ -105,11 +105,11 @@ func untilHasKey( } lw := &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, name).String() return ri.List(ctx, options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = fields.OneTermEqualSelector(kutil.ObjectNameField, name).String() return ri.Watch(ctx, options) },