From 67f4a1dade1d801f1c7c89298137c6d189807f08 Mon Sep 17 00:00:00 2001 From: Jefftree Date: Sat, 27 Jul 2024 15:47:24 +0000 Subject: [PATCH] informers: add comment that Start does not block Signed-off-by: Dr. Stefan Schimanski Kubernetes-commit: cd69335542fd961b69b4e83b6433d1b40d2f4439 --- .../informers/externalversions/factory.go | 1 + go.mod | 14 ++++++---- go.sum | 28 +++++++++---------- .../informers/externalversions/factory.go | 1 + 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/examples/client-go/pkg/client/informers/externalversions/factory.go b/examples/client-go/pkg/client/informers/externalversions/factory.go index 6c473339e..4ee8e863a 100644 --- a/examples/client-go/pkg/client/informers/externalversions/factory.go +++ b/examples/client-go/pkg/client/informers/externalversions/factory.go @@ -228,6 +228,7 @@ type SharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. Start(stopCh <-chan struct{}) // Shutdown marks a factory as shutting down. At that point no new diff --git a/go.mod b/go.mod index 1612e7d24..f523f9409 100644 --- a/go.mod +++ b/go.mod @@ -23,12 +23,12 @@ require ( google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.0.0-20240724031224-63e21d3bdab9 + k8s.io/api v0.0.0-20240801003428-382a0912e579 k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe - k8s.io/apiserver v0.0.0-20240724012351-92ee9330ce6a - k8s.io/client-go v0.0.0-20240725170742-93c6a5bf507f - k8s.io/code-generator v0.0.0-20240725171131-e64302e0e663 - k8s.io/component-base v0.0.0-20240725171331-763ac17e073e + k8s.io/apiserver v0.0.0-20240721200436-e749b346fa52 + k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9 + k8s.io/code-generator v0.0.0-20240801005206-f74ea3c4283b + k8s.io/component-base v0.0.0-20240726211132-95f30f136fb2 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 @@ -122,6 +122,8 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect - k8s.io/kms v0.0.0-20240707024556-6e3528fa4c33 // indirect + k8s.io/kms v0.0.0-20240801005948-e16c35c51bb1 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect ) + +replace k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe diff --git a/go.sum b/go.sum index 2a41c5b1f..569187d5f 100644 --- a/go.sum +++ b/go.sum @@ -365,24 +365,24 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.0.0-20240724031224-63e21d3bdab9 h1:DsdxdppkdprdzZ/IwMZY+uNpvEcKtpJpKQRgll5PXto= -k8s.io/api v0.0.0-20240724031224-63e21d3bdab9/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= -k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q= -k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/apiserver v0.0.0-20240724012351-92ee9330ce6a h1:hbHaTqnKJ9RTFAgGkhffQR1+O6RgxZnCMGIJe6paWrw= -k8s.io/apiserver v0.0.0-20240724012351-92ee9330ce6a/go.mod h1:evDFvWJ5AkEQ1nRZOHulw/OKntvjsYuxyZtZQNPhz5o= -k8s.io/client-go v0.0.0-20240725170742-93c6a5bf507f h1:PwgWcIHZw0QbiNWDz57rSH7GnSgq7d8lOo/kJoHd/DI= -k8s.io/client-go v0.0.0-20240725170742-93c6a5bf507f/go.mod h1:duh6Hk8A52zAEoC179uJBw/MGC05zB74mzfF/nESIyU= -k8s.io/code-generator v0.0.0-20240725171131-e64302e0e663 h1:EJpdOocgJatuYkRAeyrjCZy1/YA+WhbZJP4XqWD/p5A= -k8s.io/code-generator v0.0.0-20240725171131-e64302e0e663/go.mod h1:EUn13T3A/CaDKcstPAAr74dTsuy2Fzz63w8+i/ghW0c= -k8s.io/component-base v0.0.0-20240725171331-763ac17e073e h1:ja9vYNi9oyYkICpXe5PuoKrC9iW5vbSMeA8tibq0A7M= -k8s.io/component-base v0.0.0-20240725171331-763ac17e073e/go.mod h1:XV3Wb++4RAYL7uNFMN9eBFbc5SNn7qI+48cAJuBRff0= +k8s.io/api v0.0.0-20240801003428-382a0912e579 h1:pElFtnw6/eJb1SLes+tbAqfL/7IezesSZ1bLTO+b2UE= +k8s.io/api v0.0.0-20240801003428-382a0912e579/go.mod h1:sSxNOmsgxkyv9k7Nu9ysVYNCkTkTemOgz4HxbATSKDQ= +k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe h1:lt6b7CTEYMgUTCGIZrATyWMZTQThE+qIQq5YTCbpMVQ= +k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.0.0-20240721200436-e749b346fa52 h1:6I6ehNH9nR6OVP6caK2O6jfwVRTZehQUs7C+OzGrMn4= +k8s.io/apiserver v0.0.0-20240721200436-e749b346fa52/go.mod h1:evDFvWJ5AkEQ1nRZOHulw/OKntvjsYuxyZtZQNPhz5o= +k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9 h1:FtksMSsr8nNBmsSXlqvs3hPE/7BJ5wI/mJYjGypoEtk= +k8s.io/client-go v0.0.0-20240801004130-5e3e8ea98fe9/go.mod h1:2bbCJ3Sd+yFlCoexz86XNKsJ8hBFUVTeHsjEhrODbfE= +k8s.io/code-generator v0.0.0-20240801005206-f74ea3c4283b h1:aimzdOCy56Er8G846UyfiuYl79wuVHpQVUGRqr69sBU= +k8s.io/code-generator v0.0.0-20240801005206-f74ea3c4283b/go.mod h1:XFrrotr+pmB82UFRqdX7NZUw3EoWDp6baNIZOdkUns8= +k8s.io/component-base v0.0.0-20240726211132-95f30f136fb2 h1:WboNx0wmEPs9STUc0rzvjZDGwQehkG9IG5iZZzACSGE= +k8s.io/component-base v0.0.0-20240726211132-95f30f136fb2/go.mod h1:f+bznChUGzOQayYeb6iDjbWSgV/69bOcWqS2qGVD3YQ= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.0.0-20240707024556-6e3528fa4c33 h1:Wd/sRvKMgzuCdkZ/WQg2rg/j6NLW8eyw0RK8AhV9Hak= -k8s.io/kms v0.0.0-20240707024556-6e3528fa4c33/go.mod h1:x2EJv5lkGE18ijjE04e8W0fVyRPfAx5flo9WdY7a1Hw= +k8s.io/kms v0.0.0-20240801005948-e16c35c51bb1 h1:ToX+umZJUKsSS1RwlLTgst6ZlI+1U6CvD1LNpzjUTSw= +k8s.io/kms v0.0.0-20240801005948-e16c35c51bb1/go.mod h1:x2EJv5lkGE18ijjE04e8W0fVyRPfAx5flo9WdY7a1Hw= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 90319bd21..a22336a31 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -228,6 +228,7 @@ type SharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. Start(stopCh <-chan struct{}) // Shutdown marks a factory as shutting down. At that point no new