executeNode dispatches a single plan node to the appropriate API call.
(ctx context.Context, node *PlanNode)
| 136 | |
| 137 | // executeNode dispatches a single plan node to the appropriate API call. |
| 138 | func (exec *planExecutor) executeNode(ctx context.Context, node *PlanNode) error { |
| 139 | op := node.Operation |
| 140 | switch op.Type { |
| 141 | case OpCreateNetwork: |
| 142 | return exec.execCreateNetwork(ctx, op) |
| 143 | case OpRemoveNetwork: |
| 144 | return exec.execRemoveNetwork(ctx, op) |
| 145 | case OpDisconnectNetwork: |
| 146 | return exec.execDisconnectNetwork(ctx, op) |
| 147 | case OpConnectNetwork: |
| 148 | return exec.execConnectNetwork(ctx, op) |
| 149 | case OpCreateVolume: |
| 150 | return exec.execCreateVolume(ctx, op) |
| 151 | case OpRemoveVolume: |
| 152 | return exec.execRemoveVolume(ctx, op) |
| 153 | case OpCreateContainer: |
| 154 | return exec.execCreateContainer(ctx, node) |
| 155 | case OpStartContainer: |
| 156 | return exec.execStartContainer(ctx, op) |
| 157 | case OpStopContainer: |
| 158 | return exec.execStopContainer(ctx, op) |
| 159 | case OpRemoveContainer: |
| 160 | return exec.execRemoveContainer(ctx, op) |
| 161 | case OpRenameContainer: |
| 162 | return exec.execRenameContainer(ctx, node) |
| 163 | case OpRunProvider: |
| 164 | return exec.compose.runPlugin(ctx, exec.project, *op.Service, "up") |
| 165 | default: |
| 166 | return fmt.Errorf("unknown operation type: %s", op.Type) |
| 167 | } |
| 168 | } |
no test coverage detected