Update Rails and Agentk API communication structure
After discussions with the team in the Engineering Sync, we have decided that the API structure would look as follows -
// What Agentk sends to Rails
type WorkspaceAgentInfo struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
LatestK8sDeploymentInfo map[string]interface{} `json:"latest_k8s_deployment_info"`
Terminated bool `json:"terminated"`
Error string `json:"error"`
}
MRs to add Terminated
:
- GA4K
gitlab-agent
repo MR: Pass terminated flag in WorkspaceAgentInfo (gitlab-org/cluster-integration/gitlab-agent!886 - merged) - Rails
gitlab
repo MR: Pass terminated flag in WorkspaceAgentInfo (!115117 - merged)
// What Rails sends to Agentk
type WorkspaceRailsInfo struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
DeploymentResourceVersion string `json:"deployment_resource_version"`
ActualState string `json:"actual_state"`
DesiredState string `json:"desired_state"`
ConfigToApply string `json:"config_to_apply"`
}
-
As part of this update, we should also change theDeploymentResourceVersion
(and all related usages of this value) to be an Integer instead of a String. This is an integer in the Rails database, so it should be handled as an integer everywhere.- It has to be a string.
Edited by Chad Woolley