(spec *runtimespec.Spec)
| 394 | } |
| 395 | |
| 396 | func copySpec(spec *runtimespec.Spec) (*runtimespec.Spec, error) { |
| 397 | var copySpec runtimespec.Spec |
| 398 | if spec == nil { |
| 399 | return nil, errors.New("spec cannot be nil") |
| 400 | } |
| 401 | bytes, err := json.Marshal(spec) |
| 402 | if err != nil { |
| 403 | return nil, fmt.Errorf("unable to marshal spec: %w", err) |
| 404 | } |
| 405 | err = json.Unmarshal(bytes, ©Spec) |
| 406 | if err != nil { |
| 407 | return nil, fmt.Errorf("unable to unmarshal into spec copy: %w", err) |
| 408 | } |
| 409 | return ©Spec, nil |
| 410 | } |
| 411 | |
| 412 | func updateShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 413 | return completion.ContainerNames(cmd, nil) |
no test coverage detected
searching dependent graphs…