GetInformer returns the informer for the obj. If no informer exists, one will be started.
(ctx context.Context, obj client.Object, opts ...InformerGetOption)
| 157 | |
| 158 | // GetInformer returns the informer for the obj. If no informer exists, one will be started. |
| 159 | func (ic *informerCache) GetInformer(ctx context.Context, obj client.Object, opts ...InformerGetOption) (Informer, error) { |
| 160 | gvk, err := apiutil.GVKForObject(obj, ic.scheme) |
| 161 | if err != nil { |
| 162 | return nil, err |
| 163 | } |
| 164 | |
| 165 | _, i, err := ic.Informers.Get(ctx, gvk, obj, false, applyGetOptions(opts...)) |
| 166 | if err != nil { |
| 167 | return nil, err |
| 168 | } |
| 169 | return i.Informer, nil |
| 170 | } |
| 171 | |
| 172 | func (ic *informerCache) getInformerForKind(ctx context.Context, gvk schema.GroupVersionKind, obj runtime.Object) (bool, *internal.Cache, error) { |
| 173 | started, cache, err := ic.Informers.Get(ctx, gvk, obj, ic.readerFailOnMissingInformer, &internal.GetOptions{}) |
no test coverage detected