Bug 1374557

Summary: Could not update petset's replicas by editing yaml from web console.
Product: OKD Reporter: Yanping Zhang <yanpzhan>
Component: PodAssignee: Avesh Agarwal <avagarwa>
Status: CLOSED CURRENTRELEASE QA Contact: DeShuai Ma <dma>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, decarr, mmccomas, spadgett
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-30 12:50:24 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:

Description Yanping Zhang 2016-09-09 03:31:02 UTC
Description of problem:
Create PetSet in project, then try to edit the petset's yaml on other resources page, after update spec.replicas, click "Save", it prompts error:
"Failed to process the resource.
PetSet.apps "hello-petset" is invalid: spec: Forbidden: updates to petset spec for fields other than 'replicas' are forbidden."

Version-Release number of selected component (if applicable):
openshift v1.3.0-rc1+a2982d1
kubernetes v1.3.0+52492b4
etcd 2.3.0+git


How reproducible:
Always

Steps to Reproduce:
1.Create PetSet in project
#oc create -f https://raw.githubusercontent.com/mdshuai/testfile-openshift/master/petset/hello-petset.yaml
2. On Resource->Other Resources page, choose "Pet Set",then click "Actions->EDIT YAML", update spec.replicas to other value, click "Save".
3.

Actual results:
2.Could not update, prompts error:
"Failed to process the resource.
PetSet.apps "hello-petset" is invalid: spec: Forbidden: updates to petset spec for fields other than 'replicas' are forbidden."

Expected results:
3.Should be able to update replicas.

Additional info:
Could update spec.replicas by cli successfully and pods number increases accordingly.

Comment 1 Samuel Padgett 2016-09-09 12:08:19 UTC
This appears to be an API server bug. I've confirmed that the web console isn't changing any fields other than spec.replicas. The reason the CLI works is that it uses PATCH instead of PUT.

Comment 6 Avesh Agarwal 2017-01-18 18:07:03 UTC
I just tested this in latest origin and It worked as expected.

following changes I had to make in the yaml config: as PetSet has been renamed to StatefulSet and moved to app/v1beta1 from app/v1alpha1.
The final yam that I used for testing is here: https://gist.githubusercontent.com/aveshagarwal/bb78fae6e9890b4559abf6f75b4cf976/raw/b384c3ad9ef9375b80a9f5dcffed0ad17f45ea5c/hello-statefulset.yaml

After creating this service and stateful set, I increased replicas to 4 from 2 in the web console. After that replicas increased to 4 successfully.

Can we close this bug now?

Comment 7 Yanping Zhang 2017-01-20 05:34:36 UTC
Checked on origin v1.5.0-alpha.2+2543fed-29, PetSet/StatefulPet's replicas can be edited by yaml from web console, the issue has been fixed, so move the bug to Verified.