Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if OS console is not enabled, then either skip doing things or fail with a human readable error #704

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

jmazzitelli
Copy link
Contributor

@jmazzitelli jmazzitelli self-assigned this Oct 25, 2023
@jmazzitelli
Copy link
Contributor Author

jmazzitelli commented Oct 25, 2023

I may need to check the other code that installs ConsoleLinks - that may need to be skipped, too.
UPDATE: This is done. PR now handles ConsoleLinks

@jmazzitelli jmazzitelli force-pushed the ossm-2134-sane-error branch 2 times, most recently from 5498910 to d658ff2 Compare October 25, 2023 16:55
@jmazzitelli jmazzitelli changed the title if OS console is not enabled, then fail with a human readable error if OS console is not enabled, then either skip doing things or fail with a human readable error Oct 25, 2023
@jmazzitelli
Copy link
Contributor Author

jmazzitelli commented Oct 25, 2023

to test, log into an openshift cluster with istio installed, podman login to the internal image registry and:

  1. make cluster-push operator-create kiali-create
  2. confirm kiali is installed
  3. make ossmconsole-create
  4. confirm ossmc is installed
  5. uninstall ossmc and kiali via make ossmconsole-delete kiali-delete and make sure no errors occurred and everything uninstalled
  6. Follow instructions to disable the console: https://docs.openshift.com/container-platform/4.13/web_console/disabling-web-console.html but here's how to easily do it: oc patch consoles.operator.openshift.io cluster -p '{"spec": {"managementState": "Removed" }}' --type=merge ... at this point, the state should be "Removed" which you can confirm via oc get consoles.operator.openshift.io cluster -o jsonpath='{.spec.managementState}{"\n"}'
  7. make kiali-create
  8. confirm kiali is installed
  9. make ossmconsole-create
  10. Confirm you do NOT have OSSMC installed and that the operator logs an error message (oc get ossmconsole ossmconsole -n ossmconsole -oyaml). The error expected is found in the status field and should look something like this:
  - ansibleResult:
      changed: 1
      completion: 2023-10-25T18:11:31.568587
      failures: 1
      ok: 11
      skipped: 3
    lastTransitionTime: "2023-10-25T18:11:31Z"
    message: The OpenShift Console is not installed and enabled. Cannot install OSSMC.
    reason: Failed
    status: "False"
    type: Failure

When you are all done, you can put your Console back to normal via:

oc patch consoles.operator.openshift.io cluster -p '{"spec": {"managementState": "Managed" }}' --type=merge

Copy link
Contributor

@jshaughn jshaughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test steps worked as described. One bonus, after re-enablingthe console the existing CR was processed by the operator and the OSSMC was "magically" installed.

@jmazzitelli jmazzitelli merged commit 526faa3 into kiali:master Oct 26, 2023
1 check passed
@jmazzitelli jmazzitelli deleted the ossm-2134-sane-error branch October 26, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants