Bug 1437193

Summary: Unable to specify maxSurge of 0
Product: OpenShift Container Platform Reporter: Will Gordon <wgordon>
Component: Management ConsoleAssignee: Jessica Forrester <jforrest>
Status: CLOSED ERRATA QA Contact: XiaochuanWang <xiaocwan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.4.1CC: aos-bugs, jokerman, mmccomas, tdawson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: DeploymentConfig maxSurge and maxUnavailable settings were being sent to the API as strings in cases where they needed to be sent as numbers. Consequence: User could not set maxSurge or maxUnavailable to whole numbers from the web console's deployment config editor. Fix: Console will now properly send these settings to the API as strings when set to a percentage or as numbers when set to a whole number. Result: User can set deployment configuration options maxSurge and maxUnavailable to either percentages or whole numbers from the web console.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-10 05:20:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Will Gordon 2017-03-29 17:39:19 UTC
Description of problem:
When editing a deploymentconfig from the webconsole, changing Max Surge to a value of 0 causes the following error message in the web console:
An error occurred updating deployment config openshiftorg.DeploymentConfig "openshiftorg" is invalid: spec.strategy.rollingParams.maxSurge: Invalid value: "0": value should be int(5) or percentage(5%)

However, it's possible to use 0%.

Version-Release number of selected component (if applicable):
OpenShift Master: v3.4.1.10 (online version 3.4.1.14)
Kubernetes Master: v1.4.0+776c994

How reproducible:
always

Steps to Reproduce:
1. oc new-app php~https://github.com/wgordon17/openshift.org#deploy
2. Browse to https://console.preview.openshift.com/console/project/<project-name>/edit/dc/openshiftorg
3. Change "Maximum Number of Surge Pods" to 0
4. Hit save

Actual results:
An error occurred updating deployment config openshiftorg.DeploymentConfig "openshiftorg" is invalid: spec.strategy.rollingParams.maxSurge: Invalid value: "0": value should be int(5) or percentage(5%)

Expected results:
Successful save

Additional info:
Setting to 0 from CLI, `oc edit dc/openshiftorg` works without issue.

Comment 1 Jessica Forrester 2017-04-18 20:30:21 UTC
Will be fixed in https://github.com/openshift/origin-web-console/pull/1442

It is a problem for any whole number, not just zero.  It is also broken for max unavailable, or if trying to reset to the system defaults (by leaving the fields blank).

Comment 2 Troy Dawson 2017-04-19 19:33:50 UTC
This has been merged into ocp and is in OCP v3.6.39 or newer.

Comment 4 XiaochuanWang 2017-04-20 05:45:18 UTC
Verified on OpenShift v3.6.39

Any whole number for "Maximum Number of Surge Pods" including zero or leaving the field blank will not reproduce the error issue.

Leaving "Maximum Number of Surge Pods" blank will reset the value to zero which makes sense. SO it's verified on OpenShift v3.6.39

Comment 6 errata-xmlrpc 2017-08-10 05:20:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1716