// patchTerminalCondition updates the terminal condition status of the
// field export CR. The resource passed in the parameter gets updated with the
// conditions
patchTerminalCondition updates the terminal condition status of the
field export CR. The resource passed in the parameter gets updated with the
conditions
// patchTerminalCondition updates the terminal condition status of the // field export CR . The resource passed in the parameter gets updated with the // conditions
func (r *fieldExportReconciler) patchTerminalCondition(
	ctx context.Context,
	res *ackv1alpha1.FieldExport,
	err error,
) error {
	var terminalCondition *ackv1alpha1.Condition = nil
	for _, condition := range res.Status.Conditions {
		if condition.Type == ackv1alpha1.ConditionTypeTerminal {
			terminalCondition = condition
			break
		}
	}
	if terminalCondition == nil {
		terminalCondition = &ackv1alpha1.Condition{
			Type: ackv1alpha1.ConditionTypeTerminal,
		}
		res.Status.Conditions = append(res.Status.Conditions, terminalCondition)
	}
	var errMessage string
	if err != nil {
		errMessage = err.Error()
		terminalCondition.Status = corev1.ConditionTrue
		terminalCondition.Message = &errMessage
	}
	return nil
}
func ( r * fieldExportReconciler ) patchTerminalCondition ( ctx context . Context , res * ackv1alpha1 . FieldExport , err error , ) error { var terminalCondition * ackv1alpha1 . Condition = nil for _ , condition := range res . Status . Conditions { if condition . Type == ackv1alpha1 . ConditionTypeTerminal { terminalCondition = condition break } } if terminalCondition == nil { terminalCondition = & ackv1alpha1 . Condition { Type : ackv1alpha1 . ConditionTypeTerminal , } res . Status . Conditions = append ( res . Status . Conditions , terminalCondition ) } var errMessage string if err != nil { errMessage = err . Error ( ) terminalCondition . Status = corev1 . ConditionTrue terminalCondition . Message = & errMessage } return nil }
patchTerminalCondition updates the terminal condition status of the
field export CR.
patchTerminalCondition updates the terminal condition status of the field export CR .
// Terminal condition