Wrong agent_url value in the generated managed resource annotation

Summary

Every GitLab-managed resource has an annotation agent.gitlab.com/env-<kubernetes namespace> with a JSON value. This JSON included an agent_url key. This URL might be wrong when using shared agents

Reproduction steps

  1. Create a project projectA
  2. Create an agent registration project, register the agent, and share it in CI with projectA
  3. Enable managed_resources
  4. Run a job in projectA that uses managed resources
  5. Check out the annotations used, and open the link in agent_url

Actual behavior

404

Expected behavior

200 - pointing to the agent management page under the agent registration project

Example project

na

Edited by Viktor Nagy (GitLab)