Skip to content

Commit

Permalink
Use database helpers from mariadb-operator/api
Browse files Browse the repository at this point in the history
The lib-common/modules/database is moved to mariadb-operator/api to
remove a circular dependency.
  • Loading branch information
gibizer committed Oct 5, 2023
1 parent 45c4d8e commit 6d8ed9b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 60 deletions.
5 changes: 2 additions & 3 deletions controllers/barbican_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"github.com/openstack-k8s-operators/lib-common/modules/common/secret"
oko_secret "github.com/openstack-k8s-operators/lib-common/modules/common/secret"
"github.com/openstack-k8s-operators/lib-common/modules/common/util"
"github.com/openstack-k8s-operators/lib-common/modules/database"
mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -338,7 +337,7 @@ func (r *BarbicanReconciler) reconcileDelete(ctx context.Context, instance *barb
r.Log.Info(fmt.Sprintf("Reconciling Service '%s' delete", instance.Name))

// remove db finalizer first
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
}
Expand Down Expand Up @@ -588,7 +587,7 @@ func (r *BarbicanReconciler) reconcileInit(
//
// create service DB instance
//
db := database.NewDatabase(
db := mariadbv1.NewDatabase(
instance.Name,
instance.Spec.DatabaseUser,
instance.Spec.Secret,
Expand Down
4 changes: 3 additions & 1 deletion controllers/barbicanworker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ import (
barbicanv1beta1 "github.com/openstack-k8s-operators/barbican-operator/api/v1beta1"
"github.com/openstack-k8s-operators/barbican-operator/pkg/barbican"
"github.com/openstack-k8s-operators/barbican-operator/pkg/barbicanworker"

//keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1"
"github.com/openstack-k8s-operators/lib-common/modules/common"
"github.com/openstack-k8s-operators/lib-common/modules/common/condition"
"github.com/openstack-k8s-operators/lib-common/modules/common/deployment"

//"github.com/openstack-k8s-operators/lib-common/modules/common/endpoint"
"github.com/openstack-k8s-operators/lib-common/modules/common/env"
"github.com/openstack-k8s-operators/lib-common/modules/common/helper"
Expand Down Expand Up @@ -71,7 +73,7 @@ func (r *BarbicanAPIReconciler) GetScheme() *runtime.Scheme {
}
*/

// BarbicanAPIReconciler reconciles a BarbicanAPI object
// BarbicanWorkerReconciler reconciles a BarbicanAPI object
type BarbicanWorkerReconciler struct {
client.Client
Kclient kubernetes.Interface
Expand Down
34 changes: 16 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ go 1.19
require (
github.com/go-logr/logr v1.2.4
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.27.10
github.com/openshift/api v3.9.0+incompatible
github.com/openstack-k8s-operators/barbican-operator/api v0.0.0-00000000000000-000000000000
github.com/openstack-k8s-operators/infra-operator/apis v0.0.0-20230420195930-f71e24e80596
github.com/openstack-k8s-operators/keystone-operator/api v0.0.0-20230719150813-d341e7f8faa0
github.com/openstack-k8s-operators/lib-common/modules/common v0.0.0-20230714104628-12cc1e43cccd
github.com/openstack-k8s-operators/lib-common/modules/database v0.0.0-20230510145530-3c8e9179fb6e
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.0
github.com/openstack-k8s-operators/lib-common/modules/storage v0.0.0-20230427065458-ec1b923df88c
github.com/openstack-k8s-operators/mariadb-operator/api v0.0.0-20230428102546-5d2d648e367e
k8s.io/api v0.26.6
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0
k8s.io/api v0.26.9
k8s.io/apimachinery v0.27.1
k8s.io/client-go v0.26.6
k8s.io/client-go v0.26.9
sigs.k8s.io/controller-runtime v0.14.6
)

Expand Down Expand Up @@ -57,27 +56,26 @@ require (
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.10.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.3 // indirect
golang.org/x/tools v0.12.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.6 // indirect
k8s.io/component-base v0.26.6 // indirect
k8s.io/apiextensions-apiserver v0.26.9 // indirect
k8s.io/component-base v0.26.9 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
Loading

0 comments on commit 6d8ed9b

Please sign in to comment.