Enabling debug logging for the IM Operator
If you need more context for why the orchestration of the IBM Identity Management (IM) workload is failing, enable more verbose logging in the IM Operator. Modify the ClusterServiceVersion (CSV) for the IM Operator, or modify the Operator's deployment directly.
Enabling debug logging in the IM Operator CSV
Enable debug logging in the CSV by running the following code in your terminal:
# Set OPERATOR_NS to the namespace where the CSV and the IM Operator deployment are installed, for example,
# OPERATOR_NS=example-ns
if [[ -n "${OPERATOR_NS}" ]]
then
>&2 printf 'OPERATOR_NS variable set in environment; targeting CSV in namespace "%s"\n' "${OPERATOR_NS}"
NS_FLAG=( -n "${OPERATOR_NS}" )
else
LAST_PROJECT_NS="$(oc project | cut -d '"' -f2)"
>&2 printf 'OPERATOR_NS variable not set in environment; using active oc project "%s"\n' "${LAST_PROJECT_NS}"
NS_FLAG=( -n "${LAST_PROJECT_NS}" )
fi
IM_CSV="$(oc get csv "${NS_FLAG[@]}" -l operators.coreos.com/ibm-iam-operator.${OPERATOR_NS}="" -oname | cut -f2 -d'/')"
if [[ -n "${IM_CSV}" ]]
then
oc patch csv "${IM_CSV}" "${NS_FLAG[@]}" --type='json' -p='[{"op": "add", "path": "/spec/install/spec/deployments/0/spec/template/spec/containers/0/args", "value": []},{"op":"add", "path": "/spec/install/spec/deployments/0/spec/template/spec/containers/0/args/0", "value": "--zap-log-level=debug"}]'
else
>&2 printf 'Failed to get IM CSV from namespace "%s"; either this is not the correct namespace or IM Operator CSV has not been installed\n' "${NS_FLAG[2]}"
fi
Enabling debug logging on the IM Operator deployment
Enable debug logging in the deployment by running the following code in your terminal:
# Set OPERATOR_NS to the namespace where the CSV and the IM Operator deployment are installed, for example,
# OPERATOR_NS=example-ns
if [[ -n "${OPERATOR_NS}" ]]
then
>&2 printf 'OPERATOR_NS variable set in environment; targeting namespace "%s"\n' "${OPERATOR_NS}"
NS_FLAG=( -n "${OPERATOR_NS}" )
else
LAST_PROJECT_NS="$(oc project | cut -d '"' -f2)"
>&2 printf 'OPERATOR_NS variable not set in environment; targeting active oc project "%s"\n' "${LAST_PROJECT_NS}"
NS_FLAG=( -n "${LAST_PROJECT_NS}" )
fi
IM_DEPLOY="$(oc get deploy "${NS_FLAG[@]}" ibm-iam-operator -oname)"
if [[ -n "${IM_DEPLOY}" ]]
then
oc patch deploy ibm-iam-operator "${NS_FLAG[@]}" --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args", "value": []},{"op":"add", "path": "/spec/template/spec/containers/0/args/0", "value": "--zap-log-level=debug"}]'
else
>&2 printf 'Failed to get IM Deployment from namespace "%s"; either this is not the correct namespace or IM Operator Deployment has not been installed\n' "${NS_FLAG[2]}"
fi