Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1609691

Summary: [admin] Failed to update pod selector for service on console
Product: OpenShift Container Platform Reporter: XiaochuanWang <xiaocwan>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.11.0CC: aos-bugs, jhadvig, jokerman, mmccomas
Target Milestone: ---   
Target Release: 3.11.0   
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: 2018-08-10 11:35:53 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:
Attachments:
Description Flags
Failed to update and save svc pod selector by console none

Description XiaochuanWang 2018-07-30 07:59:25 UTC
Created attachment 1471440 [details]
Failed to update and save svc pod selector by console

Description of problem:
Create a service by Yaml example on console, go to Service page and edit pod selector on project list page. It failed with message.

Version-Release number of selected component (if applicable):
openshift v3.10.24
registry.reg-aws.openshift.com:443/openshift3/ose-console                 7afc9cdb911ba       283MB

How reproducible:
Always

Steps to Reproduce:
1. Go to Service page
2. Create a service by Yaml example on console which has label selector from yaml
3. Go back to Service page, click setting icon on the left of the service, click "Modify Pod Selector" 
4. Input a pair of label and save 

Actual results:
4. Failed with message:
v1.Service.Spec: v1.ServiceSpec.Selector: ReadString: expects " or n, but found {, error found in #10 byte of ...|hLabels":{"app":"tes|..., bigger context ...|":9376}],"selector":{"app":"MyApp","matchLabels":{"app":"test"}},"sessionAffinity":"None","type":"Cl|...

Expected results:
4. Should be succeed

Additional info:
Pod selector could be updated successfully by Yaml on console.

Comment 1 XiaochuanWang 2018-07-30 08:20:30 UTC
Here is related issue, adding pod selector for no-selector svc has another error as below message
"""
jsonpatch add operation does not apply: doc is missing path: /spec/selector/matchLabels
"""

Reproduced by original steps, just replace step2 as below:
2. Created service by yaml
"""
kind: Service
apiVersion: v1
metadata:
  name: my-service
  namespace: xiaocwan-t
spec:
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9376
"""

Comment 2 Jakub Hadvig 2018-07-31 10:52:52 UTC
Also 'Pod Selectors' are not loading in the Edit modal.

Comment 3 Jakub Hadvig 2018-08-01 12:12:51 UTC
Fixing PR: https://github.com/openshift/console/pull/347

Comment 4 XiaochuanWang 2018-08-10 09:02:10 UTC
Both Services with or without pod selector could be updated for selector labels. Also selector is loaded in Yaml Edit modal. Verified for working as the expected behavior.

Checked on registry.dev.redhat.io/openshift3/ose-console   v3.11.0             08ab91dff6951
oc v3.11.0-0.11.0
kubernetes v1.11.0+d4cacc0