From f5380d8518f4d7de24fa01637d108515fdc34c24 Mon Sep 17 00:00:00 2001 From: Gabriel Saratura Date: Wed, 11 Oct 2023 14:20:48 +0200 Subject: [PATCH] Fix Redis URL --- Makefile.vars.mk | 2 +- operator/rediscontroller/controller_test.go | 4 ++-- operator/rediscontroller/observe.go | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile.vars.mk b/Makefile.vars.mk index be4a25b3..c6d88a7d 100644 --- a/Makefile.vars.mk +++ b/Makefile.vars.mk @@ -26,7 +26,7 @@ UPBOUND_PACKAGE_IMG ?= $(UPBOUND_CONTAINER_REGISTRY)/$(PROJECT_OWNER)/$(PROJECT_ ## KIND:setup # https://hub.docker.com/r/kindest/node/tags -KIND_NODE_VERSION ?= v1.24.0 +KIND_NODE_VERSION ?= v1.26.6 KIND_IMAGE ?= docker.io/kindest/node:$(KIND_NODE_VERSION) KIND_KUBECONFIG ?= $(kind_dir)/kind-kubeconfig-$(KIND_NODE_VERSION) KIND_CLUSTER ?= $(PROJECT_NAME)-$(KIND_NODE_VERSION) diff --git a/operator/rediscontroller/controller_test.go b/operator/rediscontroller/controller_test.go index ef289bc4..59b12d3e 100644 --- a/operator/rediscontroller/controller_test.go +++ b/operator/rediscontroller/controller_test.go @@ -291,7 +291,7 @@ func (ts *RedisControllerTestSuite) getRedisResponse(mg *exoscalev1.Redis, setti providerSpec := mg.Spec.ForProvider master := oapi.DbaasNodeStateRoleMaster running := oapi.EnumServiceStateRunning - + uri := "https://foo:bar@baz:5321" return &oapi.GetDbaasServiceRedisResponse{ JSON200: &oapi.DbaasServiceRedis{ Maintenance: &oapi.DbaasServiceMaintenance{ @@ -318,7 +318,7 @@ func (ts *RedisControllerTestSuite) getRedisResponse(mg *exoscalev1.Redis, setti }{ Uri: &[]string{"https://foo:bar@baz:5321"}, }, - Uri: nil, + Uri: &uri, UriParams: nil, Users: nil, Version: nil, diff --git a/operator/rediscontroller/observe.go b/operator/rediscontroller/observe.go index 3f34f56b..651d2e44 100644 --- a/operator/rediscontroller/observe.go +++ b/operator/rediscontroller/observe.go @@ -106,10 +106,11 @@ func isUpToDate(current, external *exoscalev1.RedisParameters, log logr.Logger) } func connectionDetails(in oapi.DbaasServiceRedis) (map[string][]byte, error) { - if in.ConnectionInfo == nil || len(*in.ConnectionInfo.Uri) == 0 { + if in.Uri == nil { return map[string][]byte{}, nil } - uri := (*in.ConnectionInfo.Uri)[0] + + uri := *in.Uri parsed, err := url.Parse(uri) if err != nil { return nil, err