Bug 1470010

Summary: Replicaset page displays wrong deployment if matchLabels covers other deployment's
Product: OpenShift Container Platform Reporter: Xingxing Xia <xxia>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: XiaochuanWang <xiaocwan>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs, dma, jforrest, jokerman, mmccomas, tsanders, wjiang, xtian
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-07-24 11:56:08 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
Wrong-deployment-on-replicaset-page none

Description Xingxing Xia 2017-07-12 09:17:08 UTC
Description of problem:
Replicaset page displays wrong deployment if matchLabels covers other deployment's

Version-Release number of selected component (if applicable):
v3.6.140

How reproducible:
Always

Steps to Reproduce:
1. Create project xxia-proj1 and new-app with the template
$ oc new-app -f https://raw.githubusercontent.com/openshift/ansible-service-broker/ff0ca33/templates/deploy-ansible-service-broker.template.yaml

Note:
This is latest file of "master" as of bug report. This file includes:
deployment/asb which defines yaml as below:
    selector:
      matchLabels:
        app: ansible-service-broker

deployment/etcd which defines yaml as below:
    selector:
      matchLabels:
        app: ansible-service-broker  # note, here covers selector in above deployment asb
        service: etcd

2. On web console overview, click "#1" of deployment etcd

3. As comparison, create another project xxia-proj2,
download above yaml file, modify it by adding one
line "service: asb" for the "matchLabels" of deployment/asb,
then new-app with the modified yaml and check step 2.

Actual results:
2. It jumps to replicaset page of deployment/ectd, the url is correct.
But the page has some wrong places:
the breadcrumb link is shown wrongly as: Deployments >> asb >> #1
"Details" tab wrongly shows: Deployments  asb

3. The wrong places are gone.

Expected results:
2. Should fix the wrong places

Additional info:

Comment 1 Xingxing Xia 2017-07-12 09:21:23 UTC
Per step 3, maybe the template file should be fixed too: https://raw.githubusercontent.com/openshift/ansible-service-broker/master/templates/deploy-ansible-service-broker.template.yaml
So CC'ing default Dev/QA of bug component "Service Broker" to make them know.

Comment 2 Xingxing Xia 2017-07-12 09:27:36 UTC
Created attachment 1296807 [details]
Wrong-deployment-on-replicaset-page

Comment 4 openshift-github-bot 2017-07-12 14:32:50 UTC
Commit pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/14f91eb0364490ccae3a02fb371e078fd8f3bd3a
Bug 1470010 - Use owner references to find deployment on replica set page

- Avoids a problem where the label selector from another deployment
  might match a replica set, showing the wrong deployment link on the
  browse replica set page.
- Fixes a bug where an old replica set that becomes active while the
  user is on the page cannot be scaled. (This can happen if an old
  replica set revision is reused because it matches the current
  deployment spec.)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1470010

Comment 6 Xingxing Xia 2017-07-24 09:33:31 UTC
Verified in openshift v3.6.152.0-1. With original steps, now in step 2, replicaset page of deployment/ectd shows correct deployment name etcd.