func requirementIndexerFunc()

in internal/controller/requirement_controller.go [93:105]


func requirementIndexerFunc(rawObj client.Object) []string {
	// grab the Operation object, extract the owner
	op := rawObj.(*v1alpha1.Operation)
	owner := metav1.GetControllerOf(op)
	if owner == nil {
		return nil
	}
	// Make sure the owner is a Requirement object
	if owner.APIVersion != v1alpha1.GroupVersion.String() || owner.Kind != "Requirement" {
		return nil
	}
	return []string{owner.Name}
}