Fix error when displaying pod logs of pod that has multiple containers
What does this MR do?
When a pod contains more than one container, the container name has to be included in the pod_logs API call to Kubernetes otherwise the Kubernetes API returns 400.
Currently, the logs
API does not accept a container_name
parameter. So, any request for logs of a pod which has more than one container fails.
This MR makes the following changes:
-
Changes the
logs
API to accept acontainer_name
parameter. -
Adds a feature flag called
pod_logs_reactive_cache
. When the feature flag is enabled:- Reactive caching is used when making calls to the Kubernetes API.
- If
container_name
is not specified, it will return the logs of the first container in the pod.
Once we change the frontend to poll the logs
API (in order to support reactive caching), we can remove the feature flag.
Issue: #12819 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team