Skip to content

Commit 01c1d56

Browse files
Fix comments
1 parent 45079d1 commit 01c1d56

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

multiapps-controller-core/src/main/java/org/cloudfoundry/multiapps/controller/core/model/SupportedParameters.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ public class SupportedParameters {
204204
DEFAULT_SERVICE_NAME, DEFAULT_XS_APP_NAME, SERVICE, SERVICE_KEYS,
205205
SERVICE_KEY_NAME, SERVICE_NAME, SERVICE_PLAN, SERVICE_TAGS, SERVICE_BROKER,
206206
SKIP_SERVICE_UPDATES, TYPE, PROVIDER_ID, PROVIDER_NID, TARGET,
207-
SERVICE_CONFIG_PATH, FILTER, MANAGED, VERSION, PATH, MEMORY);
207+
SERVICE_CONFIG_PATH, FILTER, MANAGED, VERSION, PATH, MEMORY,
208+
FAIL_ON_SERVICE_UPDATE);
208209
public static final Set<String> GLOBAL_PARAMETERS = Set.of(KEEP_EXISTING_ROUTES, APPS_UPLOAD_TIMEOUT, APPS_TASK_EXECUTION_TIMEOUT,
209210
APPS_START_TIMEOUT, APPS_STAGE_TIMEOUT, APPLY_NAMESPACE,
210211
ENABLE_PARALLEL_DEPLOYMENTS, DEPLOY_MODE);

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public PollServiceCreateOrUpdateOperationsExecution(ServiceOperationGetter servi
2222
}
2323

2424
public PollServiceCreateOrUpdateOperationsExecution(ServiceOperationGetter serviceOperationGetter,
25-
ServiceProgressReporter serviceProgressReporter, Supplier<Boolean> shouldFailOnUpdateSupplier) {
25+
ServiceProgressReporter serviceProgressReporter,
26+
Supplier<Boolean> shouldFailOnUpdateSupplier) {
2627
super(serviceOperationGetter, serviceProgressReporter);
2728
this.shouldFailOnUpdateSupplier = shouldFailOnUpdateSupplier;
2829
}
@@ -40,8 +41,7 @@ protected List<CloudServiceInstanceExtended> getServicesData(ProcessContext cont
4041
protected ServiceOperation mapOperationState(StepLogger stepLogger, ServiceOperation lastServiceOperation,
4142
CloudServiceInstanceExtended service) {
4243
lastServiceOperation = super.mapOperationState(stepLogger, lastServiceOperation, service);
43-
if ((lastServiceOperation.getType() == ServiceOperation.Type.UPDATE && !shouldFailOnUpdateSupplier.get())
44-
&& lastServiceOperation.getState() == ServiceOperation.State.FAILED) {
44+
if (shouldIgnoreLastOperationFailure(lastServiceOperation)) {
4545
stepLogger.warn(Messages.FAILED_SERVICE_UPDATE, service.getName(), lastServiceOperation.getDescription());
4646
return new ServiceOperation(lastServiceOperation.getType(),
4747
lastServiceOperation.getDescription(),
@@ -50,6 +50,12 @@ protected ServiceOperation mapOperationState(StepLogger stepLogger, ServiceOpera
5050
return lastServiceOperation;
5151
}
5252

53+
private boolean shouldIgnoreLastOperationFailure(ServiceOperation lastServiceOperation) {
54+
return lastServiceOperation.getType() == ServiceOperation.Type.UPDATE
55+
&& lastServiceOperation.getState() == ServiceOperation.State.FAILED
56+
&& !shouldFailOnUpdateSupplier.get();
57+
}
58+
5359
@Override
5460
protected void handleMissingOperationState(StepLogger stepLogger, CloudServiceInstanceExtended service) {
5561
if (!service.isOptional()) {

0 commit comments

Comments
 (0)