Skip to content

Make logs services agnostic from environment

Adrien Kohlbecker requested to merge ak/use-cluster-in-service into master

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

Availability and Testing

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
Edited by 🤖 GitLab Bot 🤖

Merge request reports