console icon indicating copy to clipboard operation
console copied to clipboard

CONSOLE-3287, CONSOLE-3288: OLM Pages work when copied CSVs are disabled

Open TheRealJon opened this issue 2 years ago • 13 comments

  • Add copied csvs disabled flag to bridge command and server server config
  • Forward copied csvs disabled flag to frontend through js globals
  • On the installed operators page, list CSVs from 'openshift' namespace when copied csvs are disabled
  • On the CSV details page, create operand, and operand details pages:
    • use CSV from 'openshift' namespace when copied csvs are disabled, and no CSV is found in the current active namespace

TheRealJon avatar Oct 07 '22 17:10 TheRealJon

QE Approver /assign @yapei

Docs Approver: /assign @opayne1

PX Approver: /assign @RickJWagner

TheRealJon avatar Oct 07 '22 17:10 TheRealJon

@spadgett @jhadvig @zherman0 PTAL

TheRealJon avatar Oct 07 '22 17:10 TheRealJon

/label px-approved

RickJWagner avatar Oct 10 '22 19:10 RickJWagner

/label docs-approved

opayne1 avatar Oct 11 '22 11:10 opayne1

/retest

TheRealJon avatar Oct 11 '22 14:10 TheRealJon

/retest

TheRealJon avatar Oct 13 '22 14:10 TheRealJon

@TheRealJon I have a questions about this feature Will command “windows.SERVER_Flag.copiedCSVsDisabled = true” take effect on console? I mean when I use this command on the console of browser, seems the disableCopiedCSVs: true will not take effect on OLMConfig file

XiyunZhao avatar Oct 14 '22 08:10 XiyunZhao

/retest

TheRealJon avatar Oct 17 '22 13:10 TheRealJon

/retest

TheRealJon avatar Oct 17 '22 18:10 TheRealJon

Will command “windows.SERVER_Flag.copiedCSVsDisabled = true” take effect on console? I mean when I use this command on the console of browser, seems the disableCopiedCSVs: true will not take effect on OLMConfig file

@XiyunZhao no this cant be set in the browser's console, you need to set it either on the OLM Config or as a envar when running bridge server locally.

export DISABLED_COPIED_CSVS=true

jhadvig avatar Oct 18 '22 14:10 jhadvig

/retest

TheRealJon avatar Oct 18 '22 14:10 TheRealJon

/retest

TheRealJon avatar Oct 19 '22 15:10 TheRealJon

/retest

TheRealJon avatar Oct 20 '22 14:10 TheRealJon

@TheRealJon, could you help to check, when.SERVER_FLAGS.copiedCSVsDisabled is set to true, the operator installed on "openshift" namespace will show duplicate data on the Installed operator page Open Bug: https://issues.redhat.com/browse/OCPBUGS-2733 for tracking image

XiyunZhao avatar Oct 20 '22 21:10 XiyunZhao

/label tide/merge-method-squash

TheRealJon avatar Oct 24 '22 17:10 TheRealJon

/retest

TheRealJon avatar Oct 25 '22 13:10 TheRealJon

/lgtm

jhadvig avatar Oct 27 '22 07:10 jhadvig

/hold cancel

TheRealJon avatar Oct 28 '22 04:10 TheRealJon

/label qe-approved

XiyunZhao avatar Oct 28 '22 13:10 XiyunZhao

This PR has been tested on a private build. All below checkpoint is passed

  1. New flag window.SERVER_FLAGS.copiedCSVsDisabled is added and can be checked on console of browser
  2. For the administrator When the Flag is true, which means the user does not allow CSV copied in the cluster
For the operator installed in "All namespace" 
     the operator will  list in the Installed operator page only when the user selects project to "All namespace" or "openshift"
     the CSV file on other projects would be removed, user cannot use command eg: "oc get csv -n default" to get any information about the operator installed in "All namespaces"
  1. For the normal user When the Flag is true, which means the user does not allow CSV copied in the cluster
 For the operator is available in "All namespace"
    CSV will be removed, user cannot use the command **oc get csv** to get information about the operator
    The operator could not be found on the Installed operator page
 For the operator is installed in "openshift" namespace
    If the normal user does not have authority over this particular namespace
         The operator and its CSV file could not list on the Installed operator page and shown by using the command
    if the normal user has the permission 
         The operator could be listed on the Installed operator page
         Its CSV file could be found by using command "oc get csv"
         User can check the CSV details, operand details and create operand pages will only use the CSV from the openshif namespace
 For the operator is installed in other namespaces
       No change, follow the basic behavior

XiyunZhao avatar Oct 28 '22 15:10 XiyunZhao

Hi @XiyunZhao. I had a few things to follow up about your above comment. This PR needs to be tested using cluster-bot so that the changes are deployed on a cluster and tested end-to-end. Testing locally doesn't ensure that the console backend is consuming the clusterInfo.copiedCSVsDisabled property from the console config.

Secondly, I think there might be a bit of a misunderstanding about the scope of these changes. The flag we are setting does not actually disable copied CSVs on the cluster. That is a separate feature which is a part of the OLM configuration. These changes only effect console behavior. It has no effect on how OLM works on the cluster, and therefore no effect on any CLI commands. There should be no testing of oc commands involved with this PR.

Lastly, I think the expected behaviors of the UI are not quite accurately reflected here. These changes should be almost transparent to end users. When copied CSVs are disabled, both admin and normal users should be able to see globally installed operators from ANY SELECTED NAMESPACE. For normal users, this comes with the caveat that they have permission to view installed operators in the selected namespace, which is something that needs to be configured through RBAC.

So essentially the tests for this PR should be regression tests to ensure that the Installed Operators, CSV details, operand detail, and create operand pages all work as expected when copied csvs are disabled in the OLM config, and the copiedCSVsDisabled flag is set in the console config. Please let me know if there is any more clarification needed.

TheRealJon avatar Oct 28 '22 16:10 TheRealJon

Hi @XiyunZhao. I had a few things to follow up about your above comment. This PR needs to be tested using cluster-bot so that the changes are deployed on a cluster and tested end-to-end. Testing locally doesn't ensure that the console backend is consuming the clusterInfo.copiedCSVsDisabled property from the console config.

Secondly, I think there might be a bit of a misunderstanding about the scope of these changes. The flag we are setting does not actually disable copied CSVs on the cluster. That is a separate feature which is a part of the OLM configuration. These changes only effect console behavior. It has no effect on how OLM works on the cluster, and therefore no effect on any CLI commands. There should be no testing of oc commands involved with this PR.

Lastly, I think the expected behaviors of the UI are not quite accurately reflected here. These changes should be almost transparent to end users. When copied CSVs are disabled, both admin and normal users should be able to see globally installed operators from ANY SELECTED NAMESPACE. For normal users, this comes with the caveat that they have permission to view installed operators in the selected namespace, which is something that needs to be configured through RBAC.

So essentially the tests for this PR should be regression tests to ensure that the Installed Operators, CSV details, operand detail, and create operand pages all work as expected when copied csvs are disabled in the OLM config, and the copiedCSVsDisabled flag is set in the console config. Please let me know if there is any more clarification needed.

All of this being said, I think it's important that this gets into 4.12. Our unit and e2e tests are passing and I also did testing as I developed the feature, so if there is anything that was missed, we can open bugs and backport fixes.

TheRealJon avatar Oct 28 '22 16:10 TheRealJon

/retest

TheRealJon avatar Oct 31 '22 14:10 TheRealJon

/remove-label qe-approved

XiyunZhao avatar Oct 31 '22 19:10 XiyunZhao

@TheRealJon Thanks for your comments. This PR has been retested, and no issue found, give the approved label, the description and test case has been updated /label qe-approved

XiyunZhao avatar Nov 02 '22 02:11 XiyunZhao

/retest /lgtm

jhadvig avatar Nov 02 '22 13:11 jhadvig

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, TheRealJon, zherman0

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Nov 02 '22 13:11 openshift-ci[bot]

/retest

TheRealJon avatar Nov 03 '22 15:11 TheRealJon

/retest

spadgett avatar Nov 03 '22 19:11 spadgett

/retest

TheRealJon avatar Nov 04 '22 17:11 TheRealJon