func (r *PostgreSqlReconciler) GetOutput(dir string, instance *sqlv1alpha1.PostgreSql) (*sqlv1alpha1.PostgreSql, error) {
	output, errO := terraform.Output(filepath.Join(dir, "instance"))
	if errO != nil {
		errMsg := fmt.Sprintf("failed to get instance %v/%v output ", instance.Name, instance.Namespace)
		r.Log.Error(errO, errMsg)
		return nil, errO
	}
	errs, out := util.UpdateOutput(instance, output)
	if errs != nil {
		errMsg := fmt.Sprintf("failed to update instance %v/%v ", instance.Name, instance.Namespace)
		r.Log.Error(errs, errMsg)
		return nil, errs
	}
	return out, nil
}
//GetOutput get output and update the output status
GetOutput get output and update the output status
// GetOutput get output and update the output status
func (r *PostgreSqlReconciler) GetOutput(dir string, instance *sqlv1alpha1.PostgreSql) (*sqlv1alpha1.PostgreSql, error) {
	output, errO := terraform.Output(filepath.Join(dir, "instance"))
	if errO != nil {
		errMsg := fmt.Sprintf("failed to get instance %v/%v output ", instance.Name, instance.Namespace)
		r.Log.Error(errO, errMsg)
		return nil, errO
	}
	errs, out := util.UpdateOutput(instance, output)
	if errs != nil {
		errMsg := fmt.Sprintf("failed to update instance %v/%v ", instance.Name, instance.Namespace)
		r.Log.Error(errs, errMsg)
		return nil, errs
	}
	return out, nil
}
func ( r * PostgreSqlReconciler ) GetOutput ( dir string , instance * sqlv1alpha1 . PostgreSql ) ( * sqlv1alpha1 . PostgreSql , error ) { output , errO := terraform . Output ( filepath . Join ( dir , " " ) ) if errO != nil { errMsg := fmt . Sprintf ( " " , instance . Name , instance . Namespace ) r . Log . Error ( errO , errMsg ) return nil , errO } errs , out := util . UpdateOutput ( instance , output ) if errs != nil { errMsg := fmt . Sprintf ( " " , instance . Name , instance . Namespace ) r . Log . Error ( errs , errMsg ) return nil , errs } return out , nil }
GetOutput get output and update the output status
GetOutput get output and update the output status