Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions frontend/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ func (opts *FrontendOpts) Run() error {
return fmt.Errorf("failed to create the resources database client: %w", err)
}

locksDBClient, err := database.NewLocksDBClient(ctx, cosmosDatabaseClient)
if err != nil {
return fmt.Errorf("failed to create the locks database client: %w", err)
}

listener, err := net.Listen("tcp4", fmt.Sprintf(":%d", opts.port))
if err != nil {
return err
Expand Down Expand Up @@ -269,7 +264,7 @@ func (opts *FrontendOpts) Run() error {
f := frontend.NewFrontend(
logger, listener, metricsListener,
legacyregistry.Registerer(), legacyregistry.DefaultGatherer,
resourcesDBClient, locksDBClient, csClient, auditClient, opts.location, opts.clusterServiceProvisionShard,
resourcesDBClient, csClient, auditClient, opts.location, opts.clusterServiceProvisionShard,
opts.clusterServiceNoopProvision, opts.clusterServiceNoopDeprovision, opts.exitOnPanic,
)

Expand Down
3 changes: 0 additions & 3 deletions frontend/pkg/frontend/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ type Frontend struct {
server http.Server
metricsServer http.Server
resourcesDBClient database.ResourcesDBClient
locksDBClient database.LocksDBClient
auditClient audit.Client
collector *metrics.SubscriptionCollector
healthGauge prometheus.Gauge
Expand Down Expand Up @@ -88,7 +87,6 @@ func NewFrontend(
registerer prometheus.Registerer,
gatherer prometheus.Gatherer,
resourcesDBClient database.ResourcesDBClient,
locksDBClient database.LocksDBClient,
csClient ocm.ClusterServiceClientSpec,
auditClient audit.Client,
azureLocation string,
Expand Down Expand Up @@ -120,7 +118,6 @@ func NewFrontend(
},
auditClient: auditClient,
resourcesDBClient: resourcesDBClient,
locksDBClient: locksDBClient,
collector: metrics.NewSubscriptionCollector(registerer, resourcesDBClient, azureLocation),
clusterServiceProvisionShard: clusterServiceProvisionShard,
clusterServiceNoopProvision: clusterServiceNoopProvision,
Expand Down
5 changes: 0 additions & 5 deletions frontend/pkg/frontend/frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ func TestSubscriptionsGET(t *testing.T) {
reg,
reg,
mockResourcesDBClient,
databasetesting.NewMockLocksDBClient(),
nil,
newNoopAuditClient(t),
api.TestLocation,
Expand Down Expand Up @@ -250,7 +249,6 @@ func TestSubscriptionsPUT(t *testing.T) {
reg,
reg,
mockResourcesDBClient,
databasetesting.NewMockLocksDBClient(),
nil,
newNoopAuditClient(t),
api.TestLocation,
Expand Down Expand Up @@ -466,7 +464,6 @@ func TestDeploymentPreflight(t *testing.T) {
reg,
reg,
mockResourcesDBClient,
databasetesting.NewMockLocksDBClient(),
nil,
newNoopAuditClient(t),
api.TestLocation,
Expand Down Expand Up @@ -592,7 +589,6 @@ func TestRequestAdminCredential(t *testing.T) {
reg,
reg,
mockResourcesDBClient,
databasetesting.NewMockLocksDBClient(),
nil,
newNoopAuditClient(t),
api.TestLocation,
Expand Down Expand Up @@ -705,7 +701,6 @@ func TestRevokeCredentials(t *testing.T) {
reg,
reg,
mockResourcesDBClient,
databasetesting.NewMockLocksDBClient(),
nil,
newNoopAuditClient(t),
api.TestLocation,
Expand Down
103 changes: 0 additions & 103 deletions frontend/pkg/frontend/middleware_locksubscription.go

This file was deleted.

100 changes: 0 additions & 100 deletions frontend/pkg/frontend/middleware_locksubscription_test.go

This file was deleted.

4 changes: 1 addition & 3 deletions frontend/pkg/frontend/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ func (f *Frontend) routes(r prometheus.Registerer) http.Handler {
MiddlewareResourceID,
MiddlewareLoggingPostMux,
newMiddlewareValidatedAPIVersion(f.apiRegistry).handleRequest,
newMiddlewareLockSubscription(f.locksDBClient).handleRequest,
newMiddlewareValidateSubscriptionState(f.resourcesDBClient).handleRequest)
middlewareMux.Handle(
MuxPattern(http.MethodPut, PatternSubscriptions, PatternResourceGroups, PatternProviders, PatternClusters),
Expand Down Expand Up @@ -188,8 +187,7 @@ func (f *Frontend) routes(r prometheus.Registerer) http.Handler {
postMuxMiddleware.HandlerFunc(errorutils.ReportError(f.ArmSubscriptionGet)))
postMuxMiddleware = NewMiddleware(
MiddlewareResourceID,
MiddlewareLoggingPostMux,
newMiddlewareLockSubscription(f.locksDBClient).handleRequest)
MiddlewareLoggingPostMux)
middlewareMux.Handle(
MuxPattern(http.MethodPut, PatternSubscriptions),
postMuxMiddleware.HandlerFunc(errorutils.ReportError(f.ArmSubscriptionPut)))
Expand Down
2 changes: 0 additions & 2 deletions frontend/pkg/frontend/testhelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func newNoopAuditClient(t *testing.T) *audit.AuditClient {

func NewTestFrontend(t *testing.T) *Frontend {
mockResourcesDBClient := databasetesting.NewMockResourcesDBClient()
mockLocksDBClient := databasetesting.NewMockLocksDBClient()
reg := prometheus.NewRegistry()

f := NewFrontend(
Expand All @@ -46,7 +45,6 @@ func NewTestFrontend(t *testing.T) *Frontend {
reg,
reg,
mockResourcesDBClient,
mockLocksDBClient,
nil,
newNoopAuditClient(t),
api.TestLocation,
Expand Down
Loading