Hide Forgot
Description of problem: Trying to create a deployment config through 'oc create -v <filename>' and the following rolling params: ``` rollingParams: intervalSeconds: 1 maxSurge: 50% maxUnavailable: 50% timeoutSeconds: 600 updatePercent: -25 updatePeriodSeconds: 1 ``` But the dc always gets created with ``` rollingParams: intervalSeconds: 1 maxSurge: 0 maxUnavailable: 25% timeoutSeconds: 600 updatePercent: -25 updatePeriodSeconds: 1 ``` It I try to subsequently use 'oc edit' to adjust maxSurge and maxUnavailable to the desired values, edit returns "deploymentconfig <name> edited" but the values are not changed. Same issue (values don't change) if I try to set it with patch: oc patch dc router -p '{"spec":{"strategy":{"rollingParams":{"maxSurge":"50%","maxUnavailable":"50%"}}}}' Version-Release number of selected component (if applicable): Origin master How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
s/oc create -v/oc create -f
The "updatePercent: -25" will update the 'maxSurge' and 'maxUnavailable'. If you want to set the 'maxSurge' and 'maxUnavailable', you could delete 'updatePercent'.
Right, UpdatePercent is deprecated in favor of MaxSurge/MaxUnavailable: https://github.com/openshift/origin/blob/8134786b8f1deb28c821a6a41dc97888f7122fc4/pkg/deploy/api/types.go#L174
You can inspect swagger for the field: $ oc explain dc.spec.strategy.rollingParams.updatePercent FIELD: updatePercent <integer> DESCRIPTION: UpdatePercent is the percentage of replicas to scale up or down each interval. If nil, one replica will be scaled up and down each interval. If negative, the scale order will be down/up instead of up/down. DEPRECATED: Use MaxUnavailable/MaxSurge instead.
Thanks for the info on this. The operations team is currently testing upgrades from 3.2 to 3.3 and we ran into this. If updatePercent is deprecated in favor of MaxUnavailable/MaxSurge, would it be reasonable to remove updatePercent and take the newer values when requested instead of failing silently? Perhaps a deprecation warning message would be helpful in this case and notify the user that updatePercent, even though deprecated, takes precedence over the newer, recommended MaxUnavailable/MaxSurge parameters? Wouldn't it be better to have MaxUnavailable/MaxSurge take precedence when present and either ignore updatePercent or remove it altogether?
This has been deprecated since v1.0.6 [0] and there is a note in UPGRADE.md about it [1]. I guess we can remove the field altogether now. [0] https://github.com/openshift/origin/commit/086d72f1164493fccf46c975d227bf5151f30e6b [1] See point 5 in https://github.com/openshift/origin/blob/master/UPGRADE.md#origin-10x--ose-30x