Skip to content

Various fixes for Operator Patching in !131

Changes

  • Sets the TargetPort equal to the Port. Leaving this configuration out was causing the Operator to create a patch with TargetPort=0, which is not desired.
  • Wraps the controller-runtime package's CreateOrPatch method inside of our createOrPatch method. This removes some repeat code and helps us maintian some parity with other operators.
  • Defining Secret.StringData was causing the Operator to enter an endless "update" patch loop because StringData is converted automatically into Data in the Secret. This caused the Operator to continually try to patch in StringData.
  • Temporarily disables the metrics port on the Gitaly service, as it does not properly set TargetPort, which causes a reconcile loop trying to patch in TargetPort=0.

Testing instructions

Deploy operator to cluster from this branch:

TAG=various-controller-fixes CLEANUP=no ./scripts/test.sh

Wait for all pods to start up and show as Ready. Confirm in the controller logs that the end result is a complete Reconcile run that does continually loop with objects being patched repeatedly.

Edited by Mitchell Nielsen

Merge request reports

Loading