Skip to content

Commit

Permalink
chore: remove custom interface
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Apr 25, 2024
1 parent 90e937b commit f65b12e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions controllers/devdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ type (
recorder record.EventRecorder
prewarm bool
}
resourceOwner interface {
metav1.Object
runtime.Object
}
)

func newDevDB(mgr Manager, r record.EventRecorder, prewarm bool) *devDBReconciler {
Expand All @@ -74,7 +70,7 @@ func newDevDB(mgr Manager, r record.EventRecorder, prewarm bool) *devDBReconcile
}

// cleanUp clean up any resources created by the controller
func (r *devDBReconciler) cleanUp(ctx context.Context, sc resourceOwner) {
func (r *devDBReconciler) cleanUp(ctx context.Context, sc client.Object) {
// If prewarmDevDB is false, scale down the deployment to 0
if !r.prewarm {
deploy := &appsv1.Deployment{}
Expand Down Expand Up @@ -107,7 +103,7 @@ func (r *devDBReconciler) cleanUp(ctx context.Context, sc resourceOwner) {

// devURL returns the URL of the dev database for the given target URL.
// It creates a dev database if it does not exist.
func (r *devDBReconciler) devURL(ctx context.Context, sc resourceOwner, targetURL url.URL) (string, error) {
func (r *devDBReconciler) devURL(ctx context.Context, sc client.Object, targetURL url.URL) (string, error) {
drv := driver(targetURL.Scheme)
if drv == "sqlite" {
return "sqlite://db?mode=memory", nil
Expand Down

0 comments on commit f65b12e

Please sign in to comment.