func()

in internal/handler/requirement.go [254:266]


func (r *RequirementHandler) createOperation() error {
	operation := &v1alpha1.Operation{
		ObjectMeta: metav1.ObjectMeta{
			Name:      r.requirement.Status.OperationName,
			Namespace: r.requirement.Namespace,
		},
		Spec: r.requirement.Spec.Template,
	}
	if err := controllerutil.SetControllerReference(r.requirement, operation, r.client.Scheme()); err != nil {
		return fmt.Errorf("failed to set controller reference: %w", err)
	}
	return r.client.Create(context.Background(), operation)
}