You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KubePlus kubectl-applogs plugin retrieves the container logs for all the Pods corresponding to an application instance.
The implementation of this plugin has gone through several iterations. It's original design was to first discover all the Pods starting from the input Custom resource instance. For this it traversed the object graph starting from the input Custom resource instance and discovering all the objects, then following their appropriate connections (labels, env vars, spec properties, annotations), to find out other resources that are connected to the Custom resource instance, then trying to find Pods from those resources, and so on. This was before KubePlus created separate Namespace for deploying a Custom resource instance.
Once Namespace-level isolation was implemented in KubePlus, where each Custom Resource instance will be deployed in its own Namespace, figuring out what Pods belong to that Custom Resource instance, became easy. All we had to do was to find out all the Pods in the NS corresponding to that CR instance. We no longer needed traversing the object graph.
KubePlus kubectl-applogs plugin retrieves the container logs for all the Pods corresponding to an application instance.
The implementation of this plugin has gone through several iterations. It's original design was to first discover all the Pods starting from the input Custom resource instance. For this it traversed the object graph starting from the input Custom resource instance and discovering all the objects, then following their appropriate connections (labels, env vars, spec properties, annotations), to find out other resources that are connected to the Custom resource instance, then trying to find Pods from those resources, and so on. This was before KubePlus created separate Namespace for deploying a Custom resource instance.
Once Namespace-level isolation was implemented in KubePlus, where each Custom Resource instance will be deployed in its own Namespace, figuring out what Pods belong to that Custom Resource instance, became easy. All we had to do was to find out all the Pods in the NS corresponding to that CR instance. We no longer needed traversing the object graph.
However, the applogs code still has references to the earlier design. For instance, the first parameter to crlogs.py is defaulted to "connection" (https://github.com/cloud-ark/kubeplus/blob/master/plugins/kubectl-applogs#L72), but it is not really used (https://github.com/cloud-ark/kubeplus/blob/master/plugins/crlogs.py#L93).
Let's cleanup kubectl-applogs and crlogs.py for such unused code.
Let's delete any functions that are not being used.
The text was updated successfully, but these errors were encountered: