Skip to content

Commit

Permalink
chore(interface): assert every resource manager implements ResourceMa…
Browse files Browse the repository at this point in the history
…nager interface
  • Loading branch information
powerfooI committed Mar 21, 2024
1 parent bfeb951 commit 36caccd
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion internal/resource/obcluster/obcluster_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

var _ opresource.ResourceManager = &OBClusterManager{}

type OBClusterManager struct {
opresource.ResourceManager
Ctx context.Context
OBCluster *v1alpha1.OBCluster
Client client.Client
Expand Down
3 changes: 2 additions & 1 deletion internal/resource/obparameter/obparameter_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

var _ opresource.ResourceManager = &OBParameterManager{}

type OBParameterManager struct {
opresource.ResourceManager
Ctx context.Context
OBParameter *v1alpha1.OBParameter
Client client.Client
Expand Down
3 changes: 2 additions & 1 deletion internal/resource/observer/observer_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

var _ opresource.ResourceManager = &OBServerManager{}

type OBServerManager struct {
opresource.ResourceManager
Ctx context.Context
OBServer *v1alpha1.OBServer
Client client.Client
Expand Down
3 changes: 2 additions & 1 deletion internal/resource/obtenant/obtenant_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

var _ opresource.ResourceManager = &OBTenantManager{}

type OBTenantManager struct {
opresource.ResourceManager
OBTenant *v1alpha1.OBTenant
Ctx context.Context
Client client.Client
Expand Down
4 changes: 2 additions & 2 deletions internal/resource/obtenantbackup/obtenantbackup_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

type OBTenantBackupManager struct {
opresource.ResourceManager
var _ opresource.ResourceManager = &OBTenantBackupManager{}

type OBTenantBackupManager struct {
Ctx context.Context
Resource *v1alpha1.OBTenantBackup
Client client.Client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

var _ opresource.ResourceManager = &ObTenantBackupPolicyManager{}

type ObTenantBackupPolicyManager struct {
opresource.ResourceManager
Ctx context.Context
BackupPolicy *v1alpha1.OBTenantBackupPolicy
Client client.Client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

type ObTenantOperationManager struct {
opresource.ResourceManager
var _ opresource.ResourceManager = &ObTenantOperationManager{}

type ObTenantOperationManager struct {
Ctx context.Context
Resource *v1alpha1.OBTenantOperation
Client client.Client
Expand Down
4 changes: 2 additions & 2 deletions internal/resource/obtenantrestore/obtenantrestore_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

type ObTenantRestoreManager struct {
opresource.ResourceManager
var _ opresource.ResourceManager = &ObTenantRestoreManager{}

type ObTenantRestoreManager struct {
Ctx context.Context
Resource *v1alpha1.OBTenantRestore
Client client.Client
Expand Down
3 changes: 2 additions & 1 deletion internal/resource/obzone/obzone_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ import (
tasktypes "github.com/oceanbase/ob-operator/pkg/task/types"
)

var _ opresource.ResourceManager = &OBZoneManager{}

type OBZoneManager struct {
opresource.ResourceManager
Ctx context.Context
OBZone *v1alpha1.OBZone
Client client.Client
Expand Down

0 comments on commit 36caccd

Please sign in to comment.