Rails: Add API that agent will call to fetch information before starting reconciliation

MR: Add shared_namespace column to workspaces_agent... (!186035 - merged)

Description

Before the agent can start up, it needs to know about the namespaces on which it will start an informer. We do not want to read the value from the agent configuration because we have made this decision explicitly as it helps us to move away from a file based configuration in the future.

To gather the data required to start up the agent before calling the reconciliation loop, we need to add a new /internal/kubernetes/modules/remote_development/prerequisites API. This API will respond with the following data

  • workspace_namespace_mode - Value is shared if the agent's shared_namespace attribute is not nil. Else, unique.
  • shared_namesapce - the agent's shared_namespace attribute

Acceptance criteria

  • A new /internal/kubernetes/modules/remote_development/prerequisites API is added.

Implementation plan

  • Create a new class RemoteDevelopment::WorkspaceOperations::Reconcile::Main which will return the fields as described above.
  • Update EE::Api::Internal::Kubernetes to add a new endpoint and call the above class.
Edited by Vishal Tak