Skip to content

Commit 0b0394d

Browse files
Add binding id during debug
1 parent eea5616 commit 0b0394d

File tree

3 files changed

+259
-20
lines changed

3 files changed

+259
-20
lines changed

multiapps-controller-process/src/main/java/org/cloudfoundry/multiapps/controller/process/Messages.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ public class Messages {
183183
public static final String ERROR_WHILE_POLLING_SERVICE_BINDING_OPERATIONS_BETWEEN_APP_0_AND_SERVICE_INSTANCE_1 = "Error while polling service binding operations between app: \"{0}\" and service instance \"{1}\"";
184184
public static final String ERROR_WHILE_CHECKING_SERVICE_BINDING_OPERATIONS_BETWEEN_APP_0_AND_SERVICE_INSTANCE_1 = "Error while checking service binding operations between app: \"{0}\" and service instance \"{1}\"";
185185
public static final String ERROR_WHILE_CHECKING_SERVICE_BINDING_OPERATIONS_0 = "Error while checking service binding operations for service binding: \"{0}\"";
186-
public static final String ASYNC_OPERATION_FOR_SERVICE_BINDING_FAILED_WITH = "Async operation for service binding between app \"{0}\" and service instance \"{1}\" with offering \"{2}\" and plan \"{3}\" failed with \"{4}\"";
187-
public static final String ASYNC_OPERATION_FOR_USER_PROVIDED_SERVICE_BINDING_FAILED_WITH = "Async operation for service binding between app \"{0}\" and user-provided service instance \"{1}\" failed with \"{2}\"";
188-
public static final String ASYNC_OPERATION_FOR_SERVICE_BINDING_FAILED_INSTANCE_MISSING = "Async operation for service binding between app \"{0}\" and service instance \"{1}\" failed: Instance not found. Cause: {2}";
186+
public static final String ASYNC_OPERATION_FOR_SERVICE_BINDING_FAILED_WITH = "Async operation for service binding \"{0}\" between app \"{1}\" and service instance \"{2}\" with offering \"{3}\" and plan \"{4}\" failed with \"{5}\"";
187+
public static final String ASYNC_OPERATION_FOR_USER_PROVIDED_SERVICE_BINDING_FAILED_WITH = "Async operation for service binding \"{0}\" between app \"{1}\" and user-provided service instance \"{2}\" failed with \"{3}\"";
188+
public static final String ASYNC_OPERATION_FOR_SERVICE_BINDING_FAILED_INSTANCE_MISSING = "Async operation for service binding \"{0}\" between app \"{1}\" and service instance \"{2}\" failed: Instance not found. Cause: {3}";
189189
public static final String ASYNC_OPERATION_FOR_SERVICE_KEY_FAILED_WITH = "Async operation for service key of service instance \"{0}\" failed with \"{1}\"";
190190
public static final String ASYNC_OPERATION_FOR_OPTIONAL_SERVICE_KEY_FAILED_WITH = "Async operation for service key of optional service instance \"{0}\" failed with \"{1}\"";
191-
public static final String ASYNC_OPERATION_FOR_SERVICE_BINDING_FOR_OPTIONAL_SERVICE_FAILED_WITH = "Async operation for service binding for optional service between app \"{0}\" and service instance \"{1}\" failed with \"{2}\"";
191+
public static final String ASYNC_OPERATION_FOR_SERVICE_BINDING_FOR_OPTIONAL_SERVICE_FAILED_WITH = "Async operation for service binding \"{0}\" for optional service between app \"{1}\" and service instance \"{2}\" failed with \"{3}\"";
192192
public static final String ERROR_WHILE_CALCULATING_SERVICE_BINDINGS_TO_DELETE_0 = "Error while calculating service bindings to delete \"{0}\"";
193193
public static final String ERROR_WHILE_CREATING_SERVICE_KEY_0 = "Error while creating service key \"{0}\"";
194194
public static final String ERROR_WHILE_DETERMINING_SERVICE_BINDINGS_TO_DELETE = "Error while determining service bindings to delete";
@@ -694,7 +694,7 @@ public class Messages {
694694
public static final String CHECK_SHOULD_REBIND_APPLICATION_SERVICE_INSTANCE = "Check should rebind application \"{0}\" and service instance \"{1}\"";
695695
public static final String POLLING_ASYNC_OPERATION_SERVICE_BROKER = "Polling async operation of service broker \"{0}\"";
696696
public static final String ASYNC_OPERATION_SERVICE_BROKER_IN_STATE_WITH_WARNINGS = "Async operation of service broker \"{0}\" is in state \"{1}\" warnings \"{2}\"";
697-
public static final String ASYNC_OPERATION_SERVICE_BINDING_IN_STATE_WITH_WARNINGS = "Async operation of service binding is in state \"{0}\" warnings \"{1}\"";
697+
public static final String ASYNC_OPERATION_SERVICE_BINDING_IN_STATE_WITH_WARNINGS = "Async operation of service binding \"{0}\" is in state \"{1}\" warnings \"{2}\"";
698698
public static final String ASYNC_OPERATION_SERVICE_KEY_IN_STATE_WITH_WARNINGS = "Async operation of service key is in state \"{0}\" warnings \"{1}\"";
699699
public static final String SETTING_WAIT_AFTER_STOP_FOR_APP_0_TO_1_SECONDS = "Setting wait after stop for \"{0}\" to \"{1}\" seconds";
700700
public static final String DETECTING_SERVICE_KEYS_FOR_DELETION = "Detecting service keys to delete.";

multiapps-controller-process/src/main/java/org/cloudfoundry/multiapps/controller/process/steps/PollServiceBindingUnbindingOperationBaseExecution.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import java.util.List;
55
import java.util.Optional;
66
import java.util.function.Consumer;
7-
87
import org.cloudfoundry.multiapps.controller.client.facade.CloudControllerClient;
98
import org.cloudfoundry.multiapps.controller.client.facade.domain.CloudApplication;
109
import org.cloudfoundry.multiapps.controller.client.facade.domain.CloudAsyncJob;
@@ -28,6 +27,7 @@ protected boolean isOptional(ProcessContext context) {
2827
protected Consumer<CloudAsyncJob> getInProgressHandler(ProcessContext context) {
2928
return serviceBindingJob -> context.getStepLogger()
3029
.debug(Messages.ASYNC_OPERATION_SERVICE_BINDING_IN_STATE_WITH_WARNINGS,
30+
serviceBindingJob.getGuid(),
3131
serviceBindingJob.getState(), serviceBindingJob.getWarnings());
3232
}
3333

@@ -60,19 +60,22 @@ private String buildErrorMessage(CloudApplication app, CloudServiceInstance serv
6060
CloudAsyncJob serviceBindingJob) {
6161

6262
if (serviceInstance == null) {
63-
return MessageFormat.format(Messages.ASYNC_OPERATION_FOR_SERVICE_BINDING_FAILED_INSTANCE_MISSING, app.getName(),
63+
return MessageFormat.format(Messages.ASYNC_OPERATION_FOR_SERVICE_BINDING_FAILED_INSTANCE_MISSING, serviceBindingJob.getGuid(),
64+
app.getName(),
6465
serviceInstanceName, serviceBindingJob.getErrors());
6566
}
6667

6768
if (serviceInstance.isUserProvided()) {
68-
return MessageFormat.format(Messages.ASYNC_OPERATION_FOR_USER_PROVIDED_SERVICE_BINDING_FAILED_WITH, app.getName(),
69+
return MessageFormat.format(Messages.ASYNC_OPERATION_FOR_USER_PROVIDED_SERVICE_BINDING_FAILED_WITH, serviceBindingJob.getGuid(),
70+
app.getName(),
6971
serviceInstanceName, serviceBindingJob.getErrors());
7072
}
7173

7274
String serviceOffering = getValueOrMissing(serviceInstance.getLabel());
7375
String servicePlan = getValueOrMissing(serviceInstance.getPlan());
7476

75-
return MessageFormat.format(Messages.ASYNC_OPERATION_FOR_SERVICE_BINDING_FAILED_WITH, app.getName(), serviceInstanceName,
77+
return MessageFormat.format(Messages.ASYNC_OPERATION_FOR_SERVICE_BINDING_FAILED_WITH, serviceBindingJob.getGuid(), app.getName(),
78+
serviceInstanceName,
7679
serviceOffering, servicePlan, serviceBindingJob.getErrors());
7780

7881
}
@@ -88,7 +91,8 @@ protected Consumer<CloudAsyncJob> getOnErrorHandlerForOptionalResource(ProcessCo
8891
String serviceInstanceName = context.getVariable(Variables.SERVICE_TO_UNBIND_BIND);
8992
return serviceBindingJob -> context.getStepLogger()
9093
.warnWithoutProgressMessage(
91-
Messages.ASYNC_OPERATION_FOR_SERVICE_BINDING_FOR_OPTIONAL_SERVICE_FAILED_WITH, app.getName(),
94+
Messages.ASYNC_OPERATION_FOR_SERVICE_BINDING_FOR_OPTIONAL_SERVICE_FAILED_WITH,
95+
serviceBindingJob.getGuid(), app.getName(),
9296
serviceInstanceName, serviceBindingJob.getErrors());
9397
}
9498

0 commit comments

Comments
 (0)