mirror of
https://github.com/kubernetes/client-go.git
synced 2025-12-25 06:02:30 +00:00
Merge pull request #134919 from p0lyn0mial/upstream-watchlist-unsupported-wl-wrapp-remaining-lws
watchlist: wrap remaining LW with ToListWatcherWithWatchListSemantics Kubernetes-commit: 6eee830d4fa0cdb7d75dac4b3b4d22d639dce54b
This commit is contained in:
@@ -178,14 +178,14 @@ func WaitForCertificate(ctx context.Context, client clientset.Interface, reqName
|
||||
fieldSelector := fields.OneTermEqualSelector("metadata.name", reqName).String()
|
||||
logger := klog.FromContext(ctx)
|
||||
|
||||
var lw *cache.ListWatch
|
||||
var lw cache.ListerWatcher
|
||||
var obj runtime.Object
|
||||
for {
|
||||
// see if the v1 API is available
|
||||
if _, err := client.CertificatesV1().CertificateSigningRequests().List(ctx, metav1.ListOptions{FieldSelector: fieldSelector}); err == nil {
|
||||
// watch v1 objects
|
||||
obj = &certificatesv1.CertificateSigningRequest{}
|
||||
lw = &cache.ListWatch{
|
||||
lw = cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
options.FieldSelector = fieldSelector
|
||||
return client.CertificatesV1().CertificateSigningRequests().List(ctx, options)
|
||||
@@ -194,7 +194,7 @@ func WaitForCertificate(ctx context.Context, client clientset.Interface, reqName
|
||||
options.FieldSelector = fieldSelector
|
||||
return client.CertificatesV1().CertificateSigningRequests().Watch(ctx, options)
|
||||
},
|
||||
}
|
||||
}, client)
|
||||
break
|
||||
} else {
|
||||
logger.V(2).Info("Error fetching v1 certificate signing request", "err", err)
|
||||
@@ -209,7 +209,7 @@ func WaitForCertificate(ctx context.Context, client clientset.Interface, reqName
|
||||
if _, err := client.CertificatesV1beta1().CertificateSigningRequests().List(ctx, metav1.ListOptions{FieldSelector: fieldSelector}); err == nil {
|
||||
// watch v1beta1 objects
|
||||
obj = &certificatesv1beta1.CertificateSigningRequest{}
|
||||
lw = &cache.ListWatch{
|
||||
lw = cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
options.FieldSelector = fieldSelector
|
||||
return client.CertificatesV1beta1().CertificateSigningRequests().List(ctx, options)
|
||||
@@ -218,7 +218,7 @@ func WaitForCertificate(ctx context.Context, client clientset.Interface, reqName
|
||||
options.FieldSelector = fieldSelector
|
||||
return client.CertificatesV1beta1().CertificateSigningRequests().Watch(ctx, options)
|
||||
},
|
||||
}
|
||||
}, client)
|
||||
break
|
||||
} else {
|
||||
logger.V(2).Info("Error fetching v1beta1 certificate signing request", "err", err)
|
||||
|
||||
Reference in New Issue
Block a user