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 issharedif the agent'sshared_namespaceattribute is not nil. Else,unique. -
shared_namesapce- the agent'sshared_namespaceattribute
Acceptance criteria
-
A new /internal/kubernetes/modules/remote_development/prerequisitesAPI is added.
Implementation plan
- Create a new class
RemoteDevelopment::WorkspaceOperations::Reconcile::Mainwhich will return the fields as described above. - Update
EE::Api::Internal::Kubernetesto add a new endpoint and call the above class.
Edited by Vishal Tak