Kubernetes resources can be read from the JOSDK cache rather than making an explicit Kubernetes call to fetch them. This can be done in one of two ways:
Use the context object and call context.getSecondaryResource (this requires a primaryToSecondary mapper function)
Store a reference to the EventSource object at the class level and fetch the object from the cache in the event source.
Either way we should update the operator to make as few calls to Kubernetes as possible and instead rely on the JOSDK cache and event sources.
Kubernetes resources can be read from the JOSDK cache rather than making an explicit Kubernetes call to fetch them. This can be done in one of two ways:
Either way we should update the operator to make as few calls to Kubernetes as possible and instead rely on the JOSDK cache and event sources.