fix(timeoutSeconds): allow population on DeploymentConfig
fixes to allow a timeoutSeconds to be specified on the Deployment and populated on a DeploymentConfig
@@ -86,10 +86,18 @@ public class DeploymentOpenShiftConverter implements KubernetesToOpenShiftConver
if (strategy != null) {
strategyType = strategy.getType();
}
- if (openshiftDeployTimeoutSeconds != null && openshiftDeployTimeoutSeconds > 0 &&
- (Strings.isNullOrBlank(strategyType) || "Rolling".equals(strategyType))) {
+ if (openshiftDeployTimeoutSeconds != null && openshiftDeployTimeoutSeconds > 0) {
+ if (Strings.isNullOrBlank(strategyType) || "Rolling".equals(strategyType)) {
specBuilder.withNewStrategy().withType("Rolling").
withNewRollingParams().withTimeoutSeconds(openshiftDeployTimeoutSeconds).endRollingParams().endStrategy();
+ } else if (Strings.isNotBlank(strategyType)) {
+ if (strategyType.equals("Recreate")) {
+ specBuilder.withNewStrategy().withType(strategyType).
+ withNewRecreateParams().withTimeoutSeconds(openshiftDeployTimeoutSeconds).endRecreateParams().endStrategy();
+ } else {
+ specBuilder.withNewStrategy().withType(strategyType).endStrategy();
+ }
+ }
} else if (Strings.isNotBlank(strategyType)) {
// TODO is there any values we can copy across?
specBuilder.withNewStrategy().withType(strategyType).endStrategy();
