diff --git a/modules/ocp4/pages/sop_fas2discourse_operator_debugging.adoc b/modules/ocp4/pages/sop_fas2discourse_operator_debugging.adoc index 9245d84..612df61 100644 --- a/modules/ocp4/pages/sop_fas2discourse_operator_debugging.adoc +++ b/modules/ocp4/pages/sop_fas2discourse_operator_debugging.adoc @@ -23,6 +23,7 @@ metadata: This will enable full output from logging, which may aid in debugging. The following task list is contained inside the operator. This list is repeated in the reconcile loop which is currently set to run every `20 minutes`. +Reconcile loop can be adjusted in `watches.yaml` file. ---- # tasks file for Fas2discourseConfig @@ -35,3 +36,67 @@ The following task list is contained inside the operator. This list is repeated ---- The results of each call in the workflow is outputted in the log. If any task fails the entire loop stops and retries. + + +== Contributors +Simple guide to troubleshooting in codeready containers. + +# Make the change +# Tag and create new image and push to registry + Open Makefile and bump up the version + `make` + `podman push quay.io/fedora/fas2discourse-operator:` + +In case you don't have the permissions to push to the repositories in the fedora namespace, +push to your own namespace in quay.io and pull the image into crc from there. + +# Start crc and login + `crc start` + `oc login -u kubeadmin https://api.crc.testing:6443` + +# Deploy controller to the k8s cluster + `make deploy` + +# Remove the deployment and deploy again + `oc get deployments` + `oc delete ` + `make deploy` + +# Check if in correct project + `oc project fas2discourse-operator` + +# Apply Fas2DiscourseConfig custom resource + `oc apply -f config/samples/_v1alpha1_fas2discourseconfig.yaml` + +# Check t/he logs: + `oc get pods` + `oc logs -f ` + + +== Local testing or developing +The guide above will work only when running in the cluster. +For local testing, it is necessary to create a secret. +For that you have to create a [Discourse API key] +(https://meta.discourse.org/t/create-and-configure-an-api-key/230124) +(probably in staging Discourse instance) +and a [keytab file] +(https://pagure.io/fedora-infra/howtos/blob/main/f/create_keytab.md) +for kinit. + +=== Create a secret +With command `oc create secret generic`. Let's name it `fas2discourse-operator-discourse-apikey-secret`. + +`FAS2DISCOURSE_API_KEY=` +`DISCOURSE_HOST=https://askfedora.staged-by-discourse.com/` +`KEYTAB_NAME=` +`KEYTAB_PATH=` + +For example: +`oc create secret generic fas2discourse-operator-discourse-apikey-secret -n fas2discourse-operator --from-literal fas2discourse-discourse-apikey=$FAS2DISCOURSE_API_KEY --from-literal discourse-host="$DISCOURSE_HOST"` + +`oc create secret generic fas2discourse-operator-keytab-secret --from-file=$KEYTAB_NAME="$KEYTAB_PATH"` + +To confirm the secret was created, run: +`oc get secrets` + +Continue with applying the Fas2DiscourseConfig custom resource.