Rebuilds the container using cached layers by default or from scratch if full is true
(ctx context.Context, full bool)
| 194 | |
| 195 | // Rebuilds the container using cached layers by default or from scratch if full is true |
| 196 | func (i *invoker) RebuildContainer(ctx context.Context, full bool) error { |
| 197 | ctx = i.appendMetadata(ctx) |
| 198 | ctx, cancel := context.WithTimeout(ctx, requestTimeout) |
| 199 | defer cancel() |
| 200 | |
| 201 | // If full is true, we want to pass false to the RPC call to indicate that we want to do a full rebuild |
| 202 | incremental := !full |
| 203 | response, err := i.codespaceClient.RebuildContainerAsync(ctx, &codespace.RebuildContainerRequest{Incremental: &incremental}) |
| 204 | if err != nil { |
| 205 | return fmt.Errorf("failed to invoke rebuild RPC: %w", err) |
| 206 | } |
| 207 | |
| 208 | if !response.RebuildContainer { |
| 209 | return fmt.Errorf("couldn't rebuild codespace") |
| 210 | } |
| 211 | |
| 212 | return nil |
| 213 | } |
| 214 | |
| 215 | // Starts a remote SSH server to allow the user to connect to the codespace via SSH |
| 216 | func (i *invoker) StartSSHServer(ctx context.Context) (int, string, error) { |
nothing calls this directly
no test coverage detected