Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#task800#removeLoggerFromEventHub #845

Merged
merged 2 commits into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func setup() error {
psqlServerManager = resourcemanagerpsqlserver.NewPSQLServerClient(secretClient, k8sManager.GetScheme())
psqlDatabaseManager = resourcemanagerpsqldatabase.NewPSQLDatabaseClient()
psqlFirewallRuleManager = resourcemanagerpsqlfirewallrule.NewPSQLFirewallRuleClient()
eventhubNamespaceClient = resourcemanagereventhub.NewEventHubNamespaceClient(ctrl.Log.WithName("controllers").WithName("EventhubNamespace"))
eventhubNamespaceClient = resourcemanagereventhub.NewEventHubNamespaceClient()

sqlServerManager = resourcemanagersqlserver.NewAzureSqlServerManager(
secretClient,
Expand All @@ -182,7 +182,7 @@ func setup() error {
secretClient,
scheme.Scheme,
)
consumerGroupClient = resourcemanagereventhub.NewConsumerGroupClient(ctrl.Log.WithName("controllers").WithName("ConsumerGroup"))
consumerGroupClient = resourcemanagereventhub.NewConsumerGroupClient()
sqlUserManager = resourcemanagersqluser.NewAzureSqlUserManager(
secretClient,
scheme.Scheme,
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ func main() {
secretClient,
scheme,
)
eventhubNamespaceClient := resourcemanagereventhub.NewEventHubNamespaceClient(ctrl.Log.WithName("controllers").WithName("EventhubNamespace"))
consumerGroupClient := resourcemanagereventhub.NewConsumerGroupClient(ctrl.Log.WithName("controllers").WithName("ConsumerGroup"))
eventhubNamespaceClient := resourcemanagereventhub.NewEventHubNamespaceClient()
consumerGroupClient := resourcemanagereventhub.NewConsumerGroupClient()
storageManagers := resourcemanagerstorage.AzureStorageManagers
keyVaultManager := resourcemanagerkeyvault.NewAzureKeyVaultManager(ctrl.Log.WithName("keyvaultmanager").WithName("KeyVault"), mgr.GetScheme())
keyVaultKeyManager := &resourcemanagerkeyvault.KeyvaultKeyClient{
Expand Down
8 changes: 2 additions & 6 deletions pkg/resourcemanager/eventhubs/consumergroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,17 @@ import (
"github.com/Azure/azure-service-operator/pkg/resourcemanager/config"
"github.com/Azure/azure-service-operator/pkg/resourcemanager/iam"
"github.com/Azure/go-autorest/autorest"
"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"

"github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub"
)

type azureConsumerGroupManager struct {
Log logr.Logger
}

func NewConsumerGroupClient(log logr.Logger) *azureConsumerGroupManager {
return &azureConsumerGroupManager{
Log: log,
}
func NewConsumerGroupClient() *azureConsumerGroupManager {
return &azureConsumerGroupManager{}
}

func getConsumerGroupsClient() eventhub.ConsumerGroupsClient {
Expand Down
8 changes: 2 additions & 6 deletions pkg/resourcemanager/eventhubs/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/Azure/azure-service-operator/api/v1alpha1"
azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1"
"github.com/go-logr/logr"

"github.com/Azure/go-autorest/autorest"

Expand All @@ -28,7 +27,6 @@ import (
)

type azureEventHubNamespaceManager struct {
Log logr.Logger
}

func getNamespacesClient() eventhub.NamespacesClient {
Expand All @@ -39,10 +37,8 @@ func getNamespacesClient() eventhub.NamespacesClient {
return nsClient
}

func NewEventHubNamespaceClient(log logr.Logger) *azureEventHubNamespaceManager {
return &azureEventHubNamespaceManager{
Log: log,
}
func NewEventHubNamespaceClient() *azureEventHubNamespaceManager {
return &azureEventHubNamespaceManager{}
}

// DeleteNamespace deletes an existing namespace. This operation also removes all associated resources under the namespace.
Expand Down