Make logs services agnostic from environment
What does this MR do?
This is in preparation for #31105 (closed).
We need to be able to query for logs in any arbitrary namespace (gitlab-managed-apps
is an example), but today we can only query for logs in an environment (which represent a subset of possible namespaces).
By moving the translation environment->(cluster,namespace)
from the service to the controller, the service becomes agnostic from environments and can be used to query for gitlab-managed-apps
.
Access control relevant to environments is still performed at the controller level, this hasn't changed.
With this updated service, a new API can be devised with proper access control to authorise access to gitlab-managed-apps
.
Some cleanup of logs_controller_spec.rb
also went in with this MR, as some of the behaviours being tested were duplicate of service specs.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability 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
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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