Bug 1506502 - [TSB] Should not show openshift/templates on Catalog after TSB enabled
Summary: [TSB] Should not show openshift/templates on Catalog after TSB enabled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.7.0
Assignee: Scott Dodson
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks: 1534316
TreeView+ depends on / blocked
 
Reported: 2017-10-26 08:55 UTC by Yadan Pei
Modified: 2018-01-15 02:06 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
: 1534316 (view as bug list)
Environment:
Last Closed: 2017-11-28 22:19:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:3188 0 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-29 02:34:54 UTC

Description Yadan Pei 2017-10-26 08:55:23 UTC
Description of problem:
Enable Template Service Broker in ansible installation, both clusterserviceclass and templates are shown on Catalog. Since TSB is enabled, templates in openshift namespace will be converted into clusterserviceclass, should not show template any more.

Version-Release number of selected component (if applicable):
v3.7.0-0.178.0
registry.ops.openshift.com/openshift3/ose-service-catalog              v3.7                de6ddbad97f8        25 hours ago        303.4 MB

How reproducible:
Always

Steps to Reproduce:
1.Setup OCP env with TSB enabled in ansible installation
$ oc get clusterserviceclass -o=custom-columns="id:.metadata.name,external name:spec.externalName" | grep 'cakephp'
5d3bec42-ba1a-11e7-8d6f-0e117aa1d07c   cakephp-mysql-persistent
5d41ef70-ba1a-11e7-8d6f-0e117aa1d07c   cakephp-mysql-example
2.Login to web console, search catalog with text 'cakephp'


Actual results:
2. 4 items filtered out and shown

Expected results:
2. Should only show 2 clusterserviceclass

Additional info:
Env set up by oc cluster up with same service-catalog image have no such issue.

Comment 1 John Matthews 2017-10-26 13:15:22 UTC
Jessica,  

I thought this might be a web-console issue, sound related to issue you raised in this mornings meeting.

Comment 2 Jessica Forrester 2017-10-26 13:31:30 UTC
I thought the ansible install was supposed to be setting up the console extension. That said we need to rename the config option the console uses either way based on the discussion this morning.

Comment 3 Samuel Padgett 2017-10-26 17:45:15 UTC
See also

https://github.com/openshift/origin/pull/17058

Comment 4 Jessica Forrester 2017-11-01 14:06:01 UTC
The flag is getting fixed in ansible in https://github.com/openshift/openshift-ansible/pull/5912

Comment 5 Jessica Forrester 2017-11-01 14:40:15 UTC
The build this bug was opened against was from before we changed the flag name, we are concerned the installer is not properly laying down / configuring the extension for the console. Need to investigate this more.

Comment 6 Jessica Forrester 2017-11-01 16:07:44 UTC
The ansible fix is merged and I can't see anything else wrong with the tasks for setting up the TSB. Can you re-test when there is a build that includes both of these PRs:

https://github.com/openshift/origin-web-console/pull/2387
https://github.com/openshift/openshift-ansible/pull/5912

If this is still happening we need to know:

1) The content of this file on disk on the masters
/etc/origin/master/openshift-ansible-catalog-console.js
2) The master-config.yaml setting for assetConfig -> extensionScripts
3) The content of the compiled extensions.js file loaded into the browser by the web console

After collecting the above, if openshift-ansible-catalog-console.js contains content that looks like:
window.OPENSHIFT_CONSTANTS.ENABLE_TECH_PREVIEW_FEATURE.template_service_broker = true;
AND assetConfig -> extensionScripts is set to pull that file
AND extensions.js does not have the same content, then:
1) Clear the browser cache and see if the content of extensions.js changes
2) If not, restart the master and see if the content of extensions.js changes

Comment 7 Yadan Pei 2017-11-02 03:15:07 UTC
Re-tested based on comment 6,

openshift-ansible-catalog-console.js and compiled extensions.js has the same content which is an old one.
window.OPENSHIFT_CONSTANTS.ENABLE_TECH_PREVIEW_FEATURE.template_service_broker = true;

Although pr 5912 is merged to openshift-ansible, not built into rpm package yet, that's probably why the issue happens.


Will test when we get new ansible packages.

Comment 8 Jessica Forrester 2017-11-02 13:13:32 UTC
Ok thats good news, since the JS file is getting setup and served correctly then getting the ansible update for the file contents should fix this.

Comment 10 Yadan Pei 2017-11-03 10:02:36 UTC
Checked on v3.7.0-0.190.0 with registry.reg-aws.openshift.com:443/openshift3/ose-service-catalog   v3.7.0-0.190.0      2a40aff211de        17 hours ago        266 MB


Templates are not shown this time

Move to VERIFIED

Comment 11 Yadan Pei 2017-11-10 06:47:53 UTC
The issue reproduces on v3.7.5
registry.reg-aws.openshift.com:443/openshift3/ose-service-catalog     v3.7                ca30f0c47ab3        22 hours ago        266 MB


1. content of openshift-ansible-catalog-console.js
[root@host-172-16-120-76 ~]# cat /etc/origin/master/openshift-ansible-catalog-console.js 
window.OPENSHIFT_CONSTANTS.TEMPLATE_SERVICE_BROKER_ENABLED = true;


2. compiled extensions.js 
// empty file so that the master-config can still point to a file that exists
// this file will be replaced by the template service broker role if enabled
;

The v3.7.5 env is launched with openshift-ansible at master branch

Comment 12 Samuel Padgett 2017-11-10 13:57:06 UTC
If you look at master-config.yaml, is openshift-ansible-catalog-console.js listed in the asset config extension scripts?

Comment 13 Samuel Padgett 2017-11-10 15:54:50 UTC
I have a suspicion that the updated extension file is copied after the master has started, which means it isn't being picked up.

Comment 14 Yadan Pei 2017-11-13 06:43:20 UTC
Yeah, extension scripts is set correctly 
  extensionScripts:
  - /etc/origin/master/openshift-ansible-catalog-console.js

Comment 15 Samuel Padgett 2017-11-13 13:31:03 UTC
Extensions are only read on server startup. Right now the installer is copying an empty file and updating it later if TSB is enabled. The updated file appears to be copied after the master has started, however, which is why it's not taking effect. A workaround would be to restart master again.

Comment 16 ewolinet 2017-11-13 16:41:54 UTC
@Sam,

Is the fix then for the template_service_broker role to restart the master after we update the extensions js file?

Comment 17 Samuel Padgett 2017-11-13 17:42:46 UTC
Eric -- Yes, that should fix it.

Comment 18 Scott Dodson 2017-11-13 21:31:20 UTC
https://github.com/openshift/openshift-ansible/pull/6101 in progress to fix that

Comment 19 Samuel Padgett 2017-11-14 13:50:42 UTC
3.7 PR:

https://github.com/openshift/openshift-ansible/pull/6108

Comment 21 Yadan Pei 2017-11-15 07:58:55 UTC
Fixed on latest ansible openshift-ansible-3.7.8-1

Move to VERIFIED

Comment 24 errata-xmlrpc 2017-11-28 22:19:38 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/RHSA-2017:3188


Note You need to log in before you can comment on or make changes to this bug.