(cpApi *proto.CpiInterfaceClient, deployments *function_metadata.Deployments)
| 217 | } |
| 218 | |
| 219 | func (d *Dataplane) syncDeploymentCache(cpApi *proto.CpiInterfaceClient, deployments *function_metadata.Deployments) error { |
| 220 | resp, err := (*cpApi).ListServices(context.Background(), &emptypb.Empty{}) |
| 221 | if err != nil { |
| 222 | return errors.New("initial deployment cache synchronization failed") |
| 223 | } |
| 224 | |
| 225 | for i := 0; i < len(resp.Service); i++ { |
| 226 | deployments.AddDeployment(resp.Service[i], d.dataplaneID) |
| 227 | } |
| 228 | |
| 229 | return nil |
| 230 | } |
| 231 | |
| 232 | func (d *Dataplane) DrainSandbox(patch *proto.DeploymentEndpointPatch) (*proto.DeploymentUpdateSuccess, error) { |
| 233 | deployment, _ := d.deployments.GetDeployment(patch.GetService().GetName()) |
no test coverage detected