From adc02ddf7131a1cd1027274e46d0dd5309a8718d Mon Sep 17 00:00:00 2001 From: Aitor Perez <1515757+Zerpet@users.noreply.github.com> Date: Thu, 22 May 2025 16:05:00 +0100 Subject: [PATCH] Fix logging error The keys of the key-value fields for logger must be string type. We were passing the entire vhost object. --- Makefile | 4 ++-- controllers/vhost_controller.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 614d0107..fb8eae7c 100644 --- a/Makefile +++ b/Makefile @@ -210,7 +210,7 @@ K8S_OPERATOR_NAMESPACE ?= rabbitmq-system .PHONY: docker-registry-secret docker-registry-secret: $(call check_defined, DOCKER_REGISTRY_USERNAME, Username for accessing the docker registry) - $(call check_defined, DOCKER_REGISTRY_PASSWORD. Password for accessing the docker registry) + $(call check_defined, DOCKER_REGISTRY_PASSWORD, Password for accessing the docker registry) $(call check_defined, DOCKER_REGISTRY_SECRET, Name of Kubernetes secret in which to store the Docker registry username and password) $(call check_defined, DOCKER_REGISTRY_SERVER, URL of docker registry containing the Operator image (e.g. registry.my-company.com)) @echo "Creating registry secret and patching default service account" @@ -235,7 +235,7 @@ destroy: ## Delete all resources of this Operator .PHONY: deploy-dev deploy-dev: cmctl docker-build-dev manifests deploy-rbac docker-registry-secret ## Build current code as a Docker image, push the image, and deploy to current Kubernetes context $(call check_defined, DOCKER_REGISTRY_USERNAME, Username for accessing the docker registry) - $(call check_defined, DOCKER_REGISTRY_PASSWORD. Password for accessing the docker registry) + $(call check_defined, DOCKER_REGISTRY_PASSWORD, Password for accessing the docker registry) $(call check_defined, DOCKER_REGISTRY_SECRET, Name of Kubernetes secret in which to store the Docker registry username and password) $(call check_defined, DOCKER_REGISTRY_SERVER, URL of docker registry containing the Operator image (e.g. registry.my-company.com)) $(CMCTL) check api --wait=2m diff --git a/controllers/vhost_controller.go b/controllers/vhost_controller.go index a55ba19e..ef294da2 100644 --- a/controllers/vhost_controller.go +++ b/controllers/vhost_controller.go @@ -25,14 +25,14 @@ func (r *VhostReconciler) DeclareFunc(ctx context.Context, client rabbitmqclient logger := ctrl.LoggerFrom(ctx) vhost := obj.(*topology.Vhost) settings := internal.GenerateVhostSettings(vhost) - logger.Info("generated vhost settings", "vhost", vhost.Spec.Name, "settings", settings) + logger.V(1).Info("generated vhost settings", "vhost", vhost.Spec.Name, "settings", settings) err := validateResponse(client.PutVhost(vhost.Spec.Name, *settings)) if err != nil { return err } newVhostLimits := internal.GenerateVhostLimits(vhost.Spec.VhostLimits) - logger.Info("getting existing vhost limits", vhost, vhost.Spec.Name) + logger.V(1).Info("getting existing vhost limits", "vhost", vhost.Spec.Name) existingVhostLimits, err := r.getVhostLimits(client, vhost.Spec.Name) if err != nil { return err