| 2718 | |
| 2719 | auto addRunTaskOperations = [&] { |
| 2720 | foreach ( |
| 2721 | v1::Offer::Operation& operation, |
| 2722 | createOperations(frameworkId, agentId, authorization::RUN_TASK)) { |
| 2723 | if (operation.type() == v1::Offer::Operation::LAUNCH) { |
| 2724 | foreach (const v1::TaskInfo& task, operation.launch().task_infos()) { |
| 2725 | totalResources += task.resources(); |
| 2726 | totalResources += task.executor().resources(); |
| 2727 | |
| 2728 | expectedTaskStates.put( |
| 2729 | task.task_id(), |
| 2730 | authorization::RUN_TASK == GetParam() |
| 2731 | ? v1::TASK_FINISHED : v1::TASK_ERROR); |
| 2732 | } |
| 2733 | } else if (operation.type() == v1::Offer::Operation::LAUNCH_GROUP) { |
| 2734 | totalResources += operation.launch_group().executor().resources(); |
| 2735 | |
| 2736 | foreach ( |
| 2737 | const v1::TaskInfo& task, |
| 2738 | operation.launch_group().task_group().tasks()) { |
| 2739 | totalResources += task.resources(); |
| 2740 | |
| 2741 | expectedTaskStates.put( |
| 2742 | task.task_id(), |
| 2743 | authorization::RUN_TASK == GetParam() |
| 2744 | ? v1::TASK_FINISHED : v1::TASK_ERROR); |
| 2745 | } |
| 2746 | } |
| 2747 | |
| 2748 | operations.push_back(std::move(operation)); |
| 2749 | } |
| 2750 | }; |
| 2751 | |
| 2752 | addRunTaskOperations(); |
nothing calls this directly
no test coverage detected