(ctx *cu.Context, obj *unstructured.Unstructured)
| 402 | } |
| 403 | |
| 404 | func (comp *migrationsComponent) findOwnerSpec(ctx *cu.Context, obj *unstructured.Unstructured) (map[string]interface{}, error) { |
| 405 | owners, err := comp.findOwners(ctx, obj) |
| 406 | if err != nil { |
| 407 | return nil, err |
| 408 | } |
| 409 | for _, owner := range owners { |
| 410 | spec := comp.findSpecFor(ctx, owner) |
| 411 | if spec != nil { |
| 412 | return spec, nil |
| 413 | } |
| 414 | } |
| 415 | // This should be impossible since the top-level input is always a corev1.Pod. |
| 416 | return nil, errors.Errorf("error finding pod spec for %s %s/%s", obj.GetObjectKind().GroupVersionKind(), obj.GetNamespace(), obj.GetName()) |
| 417 | } |
no test coverage detected