(agent model.Agent, agentType string)
| 483 | } |
| 484 | |
| 485 | func loadBatchAgentInstall(agent model.Agent, agentType string) (batchAgentInstallContext, string) { |
| 486 | ctx := batchAgentInstallContext{agent: agent} |
| 487 | if agent.AppInstallID == 0 { |
| 488 | return ctx, "agent app install id is empty" |
| 489 | } |
| 490 | install, err := appInstallRepo.GetFirst(repo.WithByID(agent.AppInstallID)) |
| 491 | if err != nil { |
| 492 | return ctx, err.Error() |
| 493 | } |
| 494 | ctx.install = install |
| 495 | if install.App.Key != agentType { |
| 496 | return ctx, fmt.Sprintf("app key %s does not match agent type %s", install.App.Key, agentType) |
| 497 | } |
| 498 | return ctx, "" |
| 499 | } |
| 500 | |
| 501 | func buildBatchUpgradePlans(req dto.AgentBatchUpgradeReq) ([]batchUpgradePlan, []dto.AgentBatchUpgradeResult, error) { |
| 502 | agents, err := listBatchAgents(req.AgentType) |
no test coverage detected