MCPcopy Create free account
hub / github.com/coderanger/migrations-operator / findOwnerSpec

Method findOwnerSpec

components/migrations.go:404–417  ·  view source on GitHub ↗
(ctx *cu.Context, obj *unstructured.Unstructured)

Source from the content-addressed store, hash-verified

402}
403
404func (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}

Callers 1

ReconcileMethod · 0.95

Calls 2

findOwnersMethod · 0.95
findSpecForMethod · 0.95

Tested by

no test coverage detected