mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-02-15 00:07:52 +08:00
Compare commits
9 Commits
v0.31.0-al
...
kubernetes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33cdb32ddd | ||
|
|
ead90af6d9 | ||
|
|
bbe19029d1 | ||
|
|
16c4c69f34 | ||
|
|
8973d9a480 | ||
|
|
71e75ebdff | ||
|
|
9498624163 | ||
|
|
cd970a4c9d | ||
|
|
6e60f3495c |
@@ -61,6 +61,8 @@ const (
|
||||
// MessageResourceSynced is the message used for an Event fired when a Foo
|
||||
// is synced successfully
|
||||
MessageResourceSynced = "Foo synced successfully"
|
||||
// FieldManager distinguishes this controller from other things writing to API objects
|
||||
FieldManager = controllerAgentName
|
||||
)
|
||||
|
||||
// Controller is the controller implementation for Foo resources
|
||||
@@ -80,7 +82,7 @@ type Controller struct {
|
||||
// means we can ensure we only process a fixed amount of resources at a
|
||||
// time, and makes it easy to ensure we are never processing the same item
|
||||
// simultaneously in two different workers.
|
||||
workqueue workqueue.TypedRateLimitingInterface[string]
|
||||
workqueue workqueue.TypedRateLimitingInterface[cache.ObjectName]
|
||||
// recorder is an event recorder for recording Event resources to the
|
||||
// Kubernetes API.
|
||||
recorder record.EventRecorder
|
||||
@@ -106,8 +108,8 @@ func NewController(
|
||||
eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeclientset.CoreV1().Events("")})
|
||||
recorder := eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerAgentName})
|
||||
ratelimiter := workqueue.NewTypedMaxOfRateLimiter(
|
||||
workqueue.NewTypedItemExponentialFailureRateLimiter[string](5*time.Millisecond, 1000*time.Second),
|
||||
&workqueue.TypedBucketRateLimiter[string]{Limiter: rate.NewLimiter(rate.Limit(50), 300)},
|
||||
workqueue.NewTypedItemExponentialFailureRateLimiter[cache.ObjectName](5*time.Millisecond, 1000*time.Second),
|
||||
&workqueue.TypedBucketRateLimiter[cache.ObjectName]{Limiter: rate.NewLimiter(rate.Limit(50), 300)},
|
||||
)
|
||||
|
||||
controller := &Controller{
|
||||
@@ -196,64 +198,56 @@ func (c *Controller) runWorker(ctx context.Context) {
|
||||
// processNextWorkItem will read a single work item off the workqueue and
|
||||
// attempt to process it, by calling the syncHandler.
|
||||
func (c *Controller) processNextWorkItem(ctx context.Context) bool {
|
||||
obj, shutdown := c.workqueue.Get()
|
||||
objRef, shutdown := c.workqueue.Get()
|
||||
logger := klog.FromContext(ctx)
|
||||
|
||||
if shutdown {
|
||||
return false
|
||||
}
|
||||
|
||||
// We wrap this block in a func so we can defer c.workqueue.Done.
|
||||
err := func() error {
|
||||
// We call Done here so the workqueue knows we have finished
|
||||
// processing this item. We also must remember to call Forget if we
|
||||
// do not want this work item being re-queued. For example, we do
|
||||
// not call Forget if a transient error occurs, instead the item is
|
||||
// put back on the workqueue and attempted again after a back-off
|
||||
// period.
|
||||
defer c.workqueue.Done(obj)
|
||||
// Run the syncHandler, passing it the namespace/name string of the
|
||||
// Foo resource to be synced.
|
||||
if err := c.syncHandler(ctx, obj); err != nil {
|
||||
// Put the item back on the workqueue to handle any transient errors.
|
||||
c.workqueue.AddRateLimited(obj)
|
||||
return fmt.Errorf("error syncing '%s': %s, requeuing", obj, err.Error())
|
||||
}
|
||||
// Finally, if no error occurs we Forget this item so it does not
|
||||
// get queued again until another change happens.
|
||||
c.workqueue.Forget(obj)
|
||||
logger.Info("Successfully synced", "resourceName", obj)
|
||||
return nil
|
||||
}()
|
||||
// We call Done at the end of this func so the workqueue knows we have
|
||||
// finished processing this item. We also must remember to call Forget
|
||||
// if we do not want this work item being re-queued. For example, we do
|
||||
// not call Forget if a transient error occurs, instead the item is
|
||||
// put back on the workqueue and attempted again after a back-off
|
||||
// period.
|
||||
defer c.workqueue.Done(objRef)
|
||||
|
||||
if err != nil {
|
||||
utilruntime.HandleError(err)
|
||||
// Run the syncHandler, passing it the structured reference to the object to be synced.
|
||||
err := c.syncHandler(ctx, objRef)
|
||||
if err == nil {
|
||||
// If no error occurs then we Forget this item so it does not
|
||||
// get queued again until another change happens.
|
||||
c.workqueue.Forget(objRef)
|
||||
logger.Info("Successfully synced", "objectName", objRef)
|
||||
return true
|
||||
}
|
||||
|
||||
// there was a failure so be sure to report it. This method allows for
|
||||
// pluggable error handling which can be used for things like
|
||||
// cluster-monitoring.
|
||||
utilruntime.HandleErrorWithContext(ctx, err, "Error syncing; requeuing for later retry", "objectReference", objRef)
|
||||
// since we failed, we should requeue the item to work on later. This
|
||||
// method will add a backoff to avoid hotlooping on particular items
|
||||
// (they're probably still not going to work right away) and overall
|
||||
// controller protection (everything I've done is broken, this controller
|
||||
// needs to calm down or it can starve other useful work) cases.
|
||||
c.workqueue.AddRateLimited(objRef)
|
||||
return true
|
||||
}
|
||||
|
||||
// syncHandler compares the actual state with the desired, and attempts to
|
||||
// converge the two. It then updates the Status block of the Foo resource
|
||||
// with the current status of the resource.
|
||||
func (c *Controller) syncHandler(ctx context.Context, key string) error {
|
||||
// Convert the namespace/name string into a distinct namespace and name
|
||||
logger := klog.LoggerWithValues(klog.FromContext(ctx), "resourceName", key)
|
||||
|
||||
namespace, name, err := cache.SplitMetaNamespaceKey(key)
|
||||
if err != nil {
|
||||
utilruntime.HandleError(fmt.Errorf("invalid resource key: %s", key))
|
||||
return nil
|
||||
}
|
||||
func (c *Controller) syncHandler(ctx context.Context, objectRef cache.ObjectName) error {
|
||||
logger := klog.LoggerWithValues(klog.FromContext(ctx), "objectRef", objectRef)
|
||||
|
||||
// Get the Foo resource with this namespace/name
|
||||
foo, err := c.foosLister.Foos(namespace).Get(name)
|
||||
foo, err := c.foosLister.Foos(objectRef.Namespace).Get(objectRef.Name)
|
||||
if err != nil {
|
||||
// The Foo resource may no longer exist, in which case we stop
|
||||
// processing.
|
||||
if errors.IsNotFound(err) {
|
||||
utilruntime.HandleError(fmt.Errorf("foo '%s' in work queue no longer exists", key))
|
||||
utilruntime.HandleErrorWithContext(ctx, err, "Foo referenced by item in work queue no longer exists", "objectReference", objectRef)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -265,7 +259,7 @@ func (c *Controller) syncHandler(ctx context.Context, key string) error {
|
||||
// We choose to absorb the error here as the worker would requeue the
|
||||
// resource otherwise. Instead, the next time the resource is updated
|
||||
// the resource will be queued again.
|
||||
utilruntime.HandleError(fmt.Errorf("%s: deployment name must be specified", key))
|
||||
utilruntime.HandleErrorWithContext(ctx, nil, "Deployment name missing from object reference", "objectReference", objectRef)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -273,7 +267,7 @@ func (c *Controller) syncHandler(ctx context.Context, key string) error {
|
||||
deployment, err := c.deploymentsLister.Deployments(foo.Namespace).Get(deploymentName)
|
||||
// If the resource doesn't exist, we'll create it
|
||||
if errors.IsNotFound(err) {
|
||||
deployment, err = c.kubeclientset.AppsV1().Deployments(foo.Namespace).Create(context.TODO(), newDeployment(foo), metav1.CreateOptions{})
|
||||
deployment, err = c.kubeclientset.AppsV1().Deployments(foo.Namespace).Create(context.TODO(), newDeployment(foo), metav1.CreateOptions{FieldManager: FieldManager})
|
||||
}
|
||||
|
||||
// If an error occurs during Get/Create, we'll requeue the item so we can
|
||||
@@ -296,7 +290,7 @@ func (c *Controller) syncHandler(ctx context.Context, key string) error {
|
||||
// should update the Deployment resource.
|
||||
if foo.Spec.Replicas != nil && *foo.Spec.Replicas != *deployment.Spec.Replicas {
|
||||
logger.V(4).Info("Update deployment resource", "currentReplicas", *foo.Spec.Replicas, "desiredReplicas", *deployment.Spec.Replicas)
|
||||
deployment, err = c.kubeclientset.AppsV1().Deployments(foo.Namespace).Update(context.TODO(), newDeployment(foo), metav1.UpdateOptions{})
|
||||
deployment, err = c.kubeclientset.AppsV1().Deployments(foo.Namespace).Update(context.TODO(), newDeployment(foo), metav1.UpdateOptions{FieldManager: FieldManager})
|
||||
}
|
||||
|
||||
// If an error occurs during Update, we'll requeue the item so we can
|
||||
@@ -327,7 +321,7 @@ func (c *Controller) updateFooStatus(foo *samplev1alpha1.Foo, deployment *appsv1
|
||||
// we must use Update instead of UpdateStatus to update the Status block of the Foo resource.
|
||||
// UpdateStatus will not allow changes to the Spec of the resource,
|
||||
// which is ideal for ensuring nothing other than resource status has been updated.
|
||||
_, err := c.sampleclientset.SamplecontrollerV1alpha1().Foos(foo.Namespace).UpdateStatus(context.TODO(), fooCopy, metav1.UpdateOptions{})
|
||||
_, err := c.sampleclientset.SamplecontrollerV1alpha1().Foos(foo.Namespace).UpdateStatus(context.TODO(), fooCopy, metav1.UpdateOptions{FieldManager: FieldManager})
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -335,13 +329,12 @@ func (c *Controller) updateFooStatus(foo *samplev1alpha1.Foo, deployment *appsv1
|
||||
// string which is then put onto the work queue. This method should *not* be
|
||||
// passed resources of any type other than Foo.
|
||||
func (c *Controller) enqueueFoo(obj interface{}) {
|
||||
var key string
|
||||
var err error
|
||||
if key, err = cache.MetaNamespaceKeyFunc(obj); err != nil {
|
||||
if objectRef, err := cache.ObjectToName(obj); err != nil {
|
||||
utilruntime.HandleError(err)
|
||||
return
|
||||
} else {
|
||||
c.workqueue.Add(objectRef)
|
||||
}
|
||||
c.workqueue.Add(key)
|
||||
}
|
||||
|
||||
// handleObject will take any resource implementing metav1.Object and attempt
|
||||
@@ -356,12 +349,16 @@ func (c *Controller) handleObject(obj interface{}) {
|
||||
if object, ok = obj.(metav1.Object); !ok {
|
||||
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
|
||||
if !ok {
|
||||
utilruntime.HandleError(fmt.Errorf("error decoding object, invalid type"))
|
||||
// If the object value is not too big and does not contain sensitive information then
|
||||
// it may be useful to include it.
|
||||
utilruntime.HandleErrorWithContext(context.Background(), nil, "Error decoding object, invalid type", "type", fmt.Sprintf("%T", obj))
|
||||
return
|
||||
}
|
||||
object, ok = tombstone.Obj.(metav1.Object)
|
||||
if !ok {
|
||||
utilruntime.HandleError(fmt.Errorf("error decoding object tombstone, invalid type"))
|
||||
// If the object value is not too big and does not contain sensitive information then
|
||||
// it may be useful to include it.
|
||||
utilruntime.HandleErrorWithContext(context.Background(), nil, "Error decoding object tombstone, invalid type", "type", fmt.Sprintf("%T", tombstone.Obj))
|
||||
return
|
||||
}
|
||||
logger.V(4).Info("Recovered deleted object", "resourceName", object.GetName())
|
||||
|
||||
@@ -108,22 +108,22 @@ func (f *fixture) newController(ctx context.Context) (*Controller, informers.Sha
|
||||
return c, i, k8sI
|
||||
}
|
||||
|
||||
func (f *fixture) run(ctx context.Context, fooName string) {
|
||||
f.runController(ctx, fooName, true, false)
|
||||
func (f *fixture) run(ctx context.Context, fooRef cache.ObjectName) {
|
||||
f.runController(ctx, fooRef, true, false)
|
||||
}
|
||||
|
||||
func (f *fixture) runExpectError(ctx context.Context, fooName string) {
|
||||
f.runController(ctx, fooName, true, true)
|
||||
func (f *fixture) runExpectError(ctx context.Context, fooRef cache.ObjectName) {
|
||||
f.runController(ctx, fooRef, true, true)
|
||||
}
|
||||
|
||||
func (f *fixture) runController(ctx context.Context, fooName string, startInformers bool, expectError bool) {
|
||||
func (f *fixture) runController(ctx context.Context, fooRef cache.ObjectName, startInformers bool, expectError bool) {
|
||||
c, i, k8sI := f.newController(ctx)
|
||||
if startInformers {
|
||||
i.Start(ctx.Done())
|
||||
k8sI.Start(ctx.Done())
|
||||
}
|
||||
|
||||
err := c.syncHandler(ctx, fooName)
|
||||
err := c.syncHandler(ctx, fooRef)
|
||||
if !expectError && err != nil {
|
||||
f.t.Errorf("error syncing foo: %v", err)
|
||||
} else if expectError && err == nil {
|
||||
@@ -240,13 +240,9 @@ func (f *fixture) expectUpdateFooStatusAction(foo *samplecontroller.Foo) {
|
||||
f.actions = append(f.actions, action)
|
||||
}
|
||||
|
||||
func getKey(foo *samplecontroller.Foo, t *testing.T) string {
|
||||
key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(foo)
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error getting key for foo %v: %v", foo.Name, err)
|
||||
return ""
|
||||
}
|
||||
return key
|
||||
func getRef(foo *samplecontroller.Foo, t *testing.T) cache.ObjectName {
|
||||
ref := cache.MetaObjectToName(foo)
|
||||
return ref
|
||||
}
|
||||
|
||||
func TestCreatesDeployment(t *testing.T) {
|
||||
@@ -261,7 +257,7 @@ func TestCreatesDeployment(t *testing.T) {
|
||||
f.expectCreateDeploymentAction(expDeployment)
|
||||
f.expectUpdateFooStatusAction(foo)
|
||||
|
||||
f.run(ctx, getKey(foo, t))
|
||||
f.run(ctx, getRef(foo, t))
|
||||
}
|
||||
|
||||
func TestDoNothing(t *testing.T) {
|
||||
@@ -277,7 +273,7 @@ func TestDoNothing(t *testing.T) {
|
||||
f.kubeobjects = append(f.kubeobjects, d)
|
||||
|
||||
f.expectUpdateFooStatusAction(foo)
|
||||
f.run(ctx, getKey(foo, t))
|
||||
f.run(ctx, getRef(foo, t))
|
||||
}
|
||||
|
||||
func TestUpdateDeployment(t *testing.T) {
|
||||
@@ -298,7 +294,7 @@ func TestUpdateDeployment(t *testing.T) {
|
||||
|
||||
f.expectUpdateFooStatusAction(foo)
|
||||
f.expectUpdateDeploymentAction(expDeployment)
|
||||
f.run(ctx, getKey(foo, t))
|
||||
f.run(ctx, getRef(foo, t))
|
||||
}
|
||||
|
||||
func TestNotControlledByUs(t *testing.T) {
|
||||
@@ -315,7 +311,7 @@ func TestNotControlledByUs(t *testing.T) {
|
||||
f.deploymentLister = append(f.deploymentLister, d)
|
||||
f.kubeobjects = append(f.kubeobjects, d)
|
||||
|
||||
f.runExpectError(ctx, getKey(foo, t))
|
||||
f.runExpectError(ctx, getRef(foo, t))
|
||||
}
|
||||
|
||||
func int32Ptr(i int32) *int32 { return &i }
|
||||
|
||||
14
go.mod
14
go.mod
@@ -6,10 +6,10 @@ go 1.22.0
|
||||
|
||||
require (
|
||||
golang.org/x/time v0.3.0
|
||||
k8s.io/api v0.0.0-20240628062210-70c01741beda
|
||||
k8s.io/apimachinery v0.0.0-20240628061934-adf72dd6c5c2
|
||||
k8s.io/client-go v0.0.0-20240628062603-ae071bc75ff9
|
||||
k8s.io/code-generator v0.0.0-20240628063342-ab86cd677d29
|
||||
k8s.io/api v0.31.9
|
||||
k8s.io/apimachinery v0.31.9
|
||||
k8s.io/client-go v0.31.9
|
||||
k8s.io/code-generator v0.31.9
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ require (
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/go-logr/logr v1.4.1 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.22.4 // indirect
|
||||
@@ -27,7 +27,7 @@ require (
|
||||
github.com/google/gnostic-models v0.6.8 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/uuid v1.3.1 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/imdario/mergo v0.3.6 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
@@ -53,7 +53,7 @@ require (
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
|
||||
32
go.sum
32
go.sum
@@ -7,8 +7,8 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER
|
||||
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
|
||||
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
||||
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||
@@ -34,8 +34,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM=
|
||||
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
|
||||
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
|
||||
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
@@ -69,8 +69,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
||||
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
@@ -146,22 +146,22 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/api v0.0.0-20240628062210-70c01741beda h1:wQ8ASuAScWceD6yT8709GBxfyv/qevE66b3Rsi7ZJJg=
|
||||
k8s.io/api v0.0.0-20240628062210-70c01741beda/go.mod h1:Nlysps0zLruvKc0cfR9dtXQd95f5Y2XOtNtA52gutiw=
|
||||
k8s.io/apimachinery v0.0.0-20240628061934-adf72dd6c5c2 h1:Y2rD1bgpNFe3HJgKqSMzkHcOlafP3jcQLfLqADLHu3g=
|
||||
k8s.io/apimachinery v0.0.0-20240628061934-adf72dd6c5c2/go.mod h1:HaB7jl7MnnH0C8g+t13Fw226p3U88ZDog/Dt8pQRZUI=
|
||||
k8s.io/client-go v0.0.0-20240628062603-ae071bc75ff9 h1:O0BS42GzkKUruh8bq75c6mrkg5Ee7rsazpZdwsNToSU=
|
||||
k8s.io/client-go v0.0.0-20240628062603-ae071bc75ff9/go.mod h1:xdnfcLQaxsfDggWlUrix2Dps0Z9BFoIQyjtSLVk3n/s=
|
||||
k8s.io/code-generator v0.0.0-20240628063342-ab86cd677d29 h1:a06GYY32cjnLpFlUP/uxHAHhwqCEEe5wAqUV1fmyeJ4=
|
||||
k8s.io/code-generator v0.0.0-20240628063342-ab86cd677d29/go.mod h1:JOwLjDkOXIew/hfDbC+yThU169aSl8aKtLzsbx1H/AQ=
|
||||
k8s.io/api v0.31.9 h1:+gN4iZNccfr6y2EX28ZgcAq4yUKNZMhg2Jl72+2hoxQ=
|
||||
k8s.io/api v0.31.9/go.mod h1:+rao9hnuB9AHXVoqqwxPh493H91pte1ZhfJ6oz1qLJA=
|
||||
k8s.io/apimachinery v0.31.9 h1:sLGkHzsAfWVp55os8PlKw+eeIsB3IeVU1QLb3XKHyg8=
|
||||
k8s.io/apimachinery v0.31.9/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
|
||||
k8s.io/client-go v0.31.9 h1:SZr3xiDPdGwKeVR+jMYYubk1gJXA/go3obJeG/1Q/to=
|
||||
k8s.io/client-go v0.31.9/go.mod h1:ZwfOkKABRm2zSNR3s9OkADeyt0zhF9F78tJNupZM8zM=
|
||||
k8s.io/code-generator v0.31.9 h1:BHGXw8ZDNsZk0xAiBOmYxvLfSSayz1oSaBs4q3iWYkM=
|
||||
k8s.io/code-generator v0.31.9/go.mod h1:W7iHkUd4fWSs3lK39ab8T2Vy22HzRMkgjuS1mCW4KA8=
|
||||
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/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-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user