operator-framework / olm-docs

Hugo doc site for https://github.com/operator-framework/operator-lifecycle-manager
10 stars 81 forks source link

Documentation is not clear on how to enable debugging #178

Open jackson-chris opened 3 years ago

jackson-chris commented 3 years ago

https://olm.operatorframework.io/docs/tasks/troubleshooting/olm-and-catalog-operators/#how-to-view-the-catalog-operator-logs states:

Both the OLM and Catalog operators have -debug flags available that display much more useful information when diagnosing a problem. If necessary, add this flag to their deployments and perform the action that is showing undersired behavior.

but it is not clear how exactly this flag is supposed to be set, it would be good to include a patch command or alternatively an example of how to set the flag. IE. where in the deployment does the flag need to be set? Is it an additional arg like:

    Command:
      /bin/olm
    Args:
      --namespace
      $(OPERATOR_NAMESPACE)
      --writeStatusName
      operator-lifecycle-manager
      --writePackageServerStatusName
      operator-lifecycle-manager-packageserver
      --tls-cert
      /var/run/secrets/serving-cert/tls.crt
      --tls-key
      /var/run/secrets/serving-cert/tls.key
      --debug

or something else?

timflannagan commented 3 years ago

It looks like it's expecting the --debug flag here, so providing an argument makes sense looking at the helm chart template: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/deploy/chart/templates/0000_50_olm_07-olm-operator.deployment.yaml#L61-L63.

jackson-chris commented 3 years ago

That makes sense, but I don't think that will be obvious to everyone, I am suggesting this is an area where the document can be improved.

In addition the flag is different between the olm-operator and catalog-operator based upon what I see in the templates, the former uses --debug and the latter -debug. I'm not sure if these commands both accept either format (one or double dash). See: https://github.com/operator-framework/operator-lifecycle-manager/blob/master/deploy/chart/templates/0000_50_olm_08-catalog-operator.deployment.yaml

timflannagan commented 3 years ago

Yeah agreed that this is a gap in documentation - I did a poor job of conveying "this is what you can do in the meantime" in my previous comment. When playing around with the olm/catalog operators locally, it looks like both the -debug/--debug flag values are respected:

$ ./bin/catalog
INFO[0000] log level info                               
$ ./bin/catalog --debug
INFO[0000] setting logging level to DEBUG               
$ ./bin/catalog -debug
INFO[0000] setting logging level to DEBUG