-
Notifications
You must be signed in to change notification settings - Fork 532
Informer logging lacks type detail #1083
Comments
…Resource info when registering informers (needs backend change in client-go to log the gvk of the unstructured object)
@marun With a small change to reflector.go logging, an Unstructured object can be used for the expected type and GroupVersionKind could be used for logging. If this is acceptable, I can raise PRs. kubefed: client-go: |
@pjferrell I'm already working on this after discussing with @sttts earlier this week. He indicated that Unstructured support was desirable for the reflector but only to the degree that the kind be checked for and logged (vs gvk). |
Ok, just thought I'd share the diffs since we had to address this internally. IMO... as a general purpose change it'd be more helpful to provide group and kind in logs. |
…Resource info when registering informers (needs backend change in client-go to log the gvk of the unstructured object)
…Resource info when registering informers (needs backend change in client-go to log the gvk of the unstructured object)
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…Resource info when registering informers (needs backend change in client-go to log the gvk of the unstructured object)
…tured-reflector-for-logging (Updated) #1083: use unstructured runtime.Object for more detailed reflector logging
KubeFed's sync controller uses informers to watch federated resources in the host cluster and target resources in member clusters. The sync controller is configured with type information via the API to support the federation of types (e.g. CRDs) for which golang structs may not be available at compilation time. Accordingly, the sync controller configures its informers with an
ObjectType
(indicating the type of resource that will be watched) ofnil
.ObjectType
is passed by an informer to an internalReflector
instance, where it is used to:1 - check that the type of an event's object is as expected (i.e. 1)
2 - indicate the type of resource that a log pertains to (e.g. 1, 2)
Passing
nil
forObjectType
avoids the type check to support watching resources for which a golang struct is not available, but also results in mostReflector
log messages displaying<nil>
instead of a type name:Ideally
Reflector
could be configured with atypeName
to be used in log messages. IftypeName
were not provided, it would be continue to be computed asexpectedType.String()
. A new constructor forReflector
andInformer
could be added to support provision oftypeName
.Note that KubeFed would likely prefer to supply a
typeName
of<cluster name>/<type name>
to ensure traceability of an informer not just to a sync controller but also to the cluster it is targeting.The text was updated successfully, but these errors were encountered: