From 9ec9f823c28d67ef90d2c01b35b0bc863d2a873b Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Mon, 2 Oct 2023 13:10:32 +0200 Subject: [PATCH] Use database helpers from mariadb-operator/api The lib-common/modules/database is moved to mariadb-operator/api to remove a circular dependency. --- controllers/keystoneapi_controller.go | 5 ++--- go.mod | 3 +-- go.sum | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/controllers/keystoneapi_controller.go b/controllers/keystoneapi_controller.go index 27663094..6e786ada 100644 --- a/controllers/keystoneapi_controller.go +++ b/controllers/keystoneapi_controller.go @@ -39,7 +39,6 @@ import ( oko_secret "github.com/openstack-k8s-operators/lib-common/modules/common/secret" "github.com/openstack-k8s-operators/lib-common/modules/common/service" util "github.com/openstack-k8s-operators/lib-common/modules/common/util" - database "github.com/openstack-k8s-operators/lib-common/modules/database" mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1" "gopkg.in/yaml.v2" @@ -300,7 +299,7 @@ func (r *KeystoneAPIReconciler) reconcileDelete(ctx context.Context, instance *k } // remove db finalizer before the keystone one - db, err := database.GetDatabaseByName(ctx, helper, instance.Name) + db, err := mariadbv1.GetDatabaseByName(ctx, helper, instance.Name) if err != nil && !k8s_errors.IsNotFound(err) { return ctrl.Result{}, err } @@ -353,7 +352,7 @@ func (r *KeystoneAPIReconciler) reconcileInit( // // create service DB instance // - db := database.NewDatabase( + db := mariadbv1.NewDatabase( instance.Name, instance.Spec.DatabaseUser, instance.Spec.Secret, diff --git a/go.mod b/go.mod index 5af6af5f..c417dc4f 100644 --- a/go.mod +++ b/go.mod @@ -10,10 +10,9 @@ require ( github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20231001103054-f74a88ed4971 github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230920085319-92ae0260bbf3 github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20231001084618-12369665b166 - github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20231001084618-12369665b166 github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20231001084618-12369665b166 github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20231001084618-12369665b166 - github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230928152002-65395552e015 + github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.26.9 k8s.io/apimachinery v0.26.9 diff --git a/go.sum b/go.sum index df4dc360..c2d93b37 100644 --- a/go.sum +++ b/go.sum @@ -240,14 +240,12 @@ github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20231001103054-f github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20231001103054-f74a88ed4971/go.mod h1:zqFs5MrBKeaE4HQroUgMWwIkBwmmcygg6sghcidSdCA= github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20231001084618-12369665b166 h1:pZPl9njjTchHSFf2OSuzyRxrRW8LLb1OscPxVNoATrk= github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20231001084618-12369665b166/go.mod h1:Ozg6SxfwOtMkiH553c0XQBWuygZQq4jDQCpR4hZqlxM= -github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20231001084618-12369665b166 h1:63I4+qBYwm0Q2txAZRfJ2TRo5HyBJwHxDYSpOr+jOOo= -github.com/openstack-k8s-operators/lib-common/modules/database v0.1.1-0.20231001084618-12369665b166/go.mod h1:RroLfB6Wstc+z7JVJY9o+6YPu+wBIzTAAfMpwhv7pDI= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20231001084618-12369665b166 h1:zOnRGMdgq2XvOCCtF1lY4tFhKx3jXrcrtOiZZ1PR6M8= github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20231001084618-12369665b166/go.mod h1:LOXXvTQCwhOBNd+0FTlgllpa3wqlkI6Vf3Q5QVRVPlw= github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20231001084618-12369665b166 h1:lh3WHM+3DcPlXK4I3QWHmvV+cPCy+dmiMdfImHF/Nqc= github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20231001084618-12369665b166/go.mod h1:z/Plc5ef+C/lFZMTHGdOdoo04mimjXyqS9DZKxCzlXk= -github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230928152002-65395552e015 h1:1G37nuB9C8QPp7tScEpwbR7eQj+2e6l089MNzj5cChk= -github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230928152002-65395552e015/go.mod h1:xhiz5wFdKWwVM7BF/VYon4TT3NuUPXp/Pyn2hWcp0CE= +github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0 h1:FB0xB6whYM6W4XIncYo2mPiOJWkFsIOWtCT+UOtvOaQ= +github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0/go.mod h1:xhiz5wFdKWwVM7BF/VYon4TT3NuUPXp/Pyn2hWcp0CE= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=