()
| 76 | } |
| 77 | |
| 78 | func (controller *Controller) initContainers() (err error) { |
| 79 | // TODO: sync from funclet for more runtime information |
| 80 | nodeInfo, err := controller.FuncletClient.NodeInfo(&api.FuncletClientListNodeInput{RequestID: id.GetRequestID()}) |
| 81 | if err != nil { |
| 82 | return err |
| 83 | } |
| 84 | params := &rtctrl.RuntimeManagerParameters{ |
| 85 | MaxRuntimeIdle: controller.runOptions.MaxRuntimeIdle, |
| 86 | MaxRunnerDefunct: controller.runOptions.MaxRunnerDefunct, |
| 87 | MaxRunnerResetTimeout: controller.runOptions.MaxRunnerResetTimeout, |
| 88 | } |
| 89 | controller.runtimeDispatcher = rtctrl.NewRuntimeManager(nodeInfo, params) |
| 90 | |
| 91 | res, err := controller.FuncletClient.List(&api.FuncletClientListContainersInput{RequestID: id.GetRequestID()}) |
| 92 | if err != nil { |
| 93 | return err |
| 94 | } |
| 95 | allContainers := *res |
| 96 | logs.Infof("get container %+v", allContainers) |
| 97 | |
| 98 | for _, container := range allContainers { |
| 99 | // set default runtime concurrent mode from service option |
| 100 | params := &rtctrl.NewRuntimeParameters{ |
| 101 | RuntimeID: container.ContainerID, |
| 102 | ConcurrentMode: controller.runOptions.ConcurrentMode, |
| 103 | StreamMode: container.WithStreamMode, |
| 104 | WaitRuntimeAliveTimeout: controller.runOptions.RuntimeConfigOptions.WaitRuntimeAliveTimeout, |
| 105 | IsFrozen: container.IsFrozen, |
| 106 | Resource: container.Resource, |
| 107 | } |
| 108 | controller.runtimeDispatcher.NewRuntime(params) |
| 109 | } |
| 110 | return nil |
| 111 | } |
no test coverage detected