Description of problem: The documentation [0] indicates that you can serve static files from the master directly into the console. It also indicates that you can change where the users download the CLI tools. If you provide a link in the cli downloads page to download a static hosted file you get redirected back to the projects page. [0] https://docs.openshift.com/enterprise/3.2/install_config/web_console_customization.html#serving-static-files [1] https://docs.openshift.com/enterprise/3.2/install_config/web_console_customization.html#adding-or-changing-links-to-download-the-cli Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. mkdir /root/teststuff 2. for x in 1 2 3 ; do echo $x > /root/teststuff/$x.txt ; done 3. cat my.js window.OPENSHIFT_CONSTANTS.CLI = { "Mac OS X": "https://masterthing.novalocal:8443/console/extensions/downloads/2.txt" }; cat /etc/origin/master/master-config.yaml ... assetConfig: extensionScripts: - /root/my.js extensions: - name: downloads sourceDirectory: /root/teststuff ... 4. systemctl restart atomic-openshift-master In web browser: 5. visit OpenShift Cluster Hostname 6. click "?" dropdown 7. click "Command Line Tools" 8. click "Mac OS X" Actual results: Redirected back to projects page Expected results: Visit webpage with static file (either to download or see, not clear what should happen at that point) Additional info: Attaching shortly screenshots from environment as well as HAR file generated by Firefox after right-clicking and selecting "Inspect Element", changing to "Network" and doing the last portion of the reproducer steps(from "In web browser" on).
The extensions are working. The problem is the Angular router is trying to handle the link as an internal app link rather than loading the page from the server.
https://github.com/openshift/origin-web-console/pull/558
3.3.1 fix: https://github.com/openshift/origin-web-console/pull/559
@Samuel, is there a way to workaround that for now? I currently have a customer using 3.2.X that is running into this issue
Eric, unfortunately I don't think there's a workaround other than to put the download on a different host rather than using an extension. To make the download work as an extension requires this fix.
(In reply to Samuel Padgett from comment #2) > The extensions are working. The problem is the Angular router is trying to > handle the link as an internal app link rather than loading the page from > the server. So essentially, I can setup the extension (which works properly), I cannot host any file for download. This fix you added will only work for the CLI downloads, from what I was able to see. How does this fix get added for the generic extension that any admin can setup? What information does a user (and therefore the docs) need to setup a functional download after this fix?
> So essentially, I can setup the extension (which works properly), I cannot host any file for download. No, the download itself works fine. It's a problem with the CLI download _link_ in the web console specifically. Since the host and "/console" context match the web console's, AngularJS is handling it as an internal application link and not making a request to the server for the content. If you right click and open the CLI download link in a new window, or just paste the link into a blank browser window, the download should work. > What information does a user (and therefore the docs) need to setup a functional download after this fix? There's no change to how you would set up the download. The instructions in the bug description will work with this fix.
yapei, can we add a test case for this problem?
Sure, planned to add, will attach later
Sorry, Eric Please ignore my needinfo request
Hi Samuel, Test Case 501623 is updated, step 1- step5 is added to check this issue.
Could you please take a look?
Test case looks good to me, thanks
Checked against openshift v3.3.1.1 kubernetes v1.3.0+52492b4 etcd 2.3.0+git with steps: 1. Prepare the static files and CLI download link files # mkdir /root/testfiles # echo 1 > /root/testfiles/1.txt # cat /root/cli-links.js window.OPENSHIFT_CONSTANTS.CLI = { "Mac OS X": "https://<master>:8443/console/extensions/downloads/1.txt" }; 2. Modify your master-config.yaml assetConfig: extensionScripts: - /root/cli-links.js extensions: - name: downloads sourceDirectory: /root/testfiles 3. Restart atomic-openshift-master # systemctl restart atomic-openshift-master 4. Logout -> Login web console again 5. click "?" dropdown click "Command Line Tools" click "Mac OS X" 6. Number 1 is returned on page Now it returns the correct content of static files, move to VERIFIED
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/RHBA-2016:2084