From 81954166de6f88e27ac7472344c44faa1d6c9f9a Mon Sep 17 00:00:00 2001 From: hobu <37413937+buhongw7583c@users.noreply.github.com> Date: Tue, 31 Mar 2020 16:44:26 +0800 Subject: [PATCH] task#800RmLoggerRedisCache --- controllers/suite_test.go | 1 - main.go | 1 - pkg/resourcemanager/rediscaches/rediscaches.go | 5 +---- pkg/resourcemanager/rediscaches/suite_test.go | 6 ++---- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 2f4da2fcd84..b6172b6c8e7 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -171,7 +171,6 @@ func setup() error { scheme.Scheme, ) redisCacheManager := resourcemanagerrediscaches.NewAzureRedisCacheManager( - ctrl.Log.WithName("rediscachemanager").WithName("RedisCache"), secretClient, scheme.Scheme, ) diff --git a/main.go b/main.go index 1feaedc4393..e07a54b0f12 100644 --- a/main.go +++ b/main.go @@ -111,7 +111,6 @@ func main() { resourceGroupManager := resourcemanagerresourcegroup.NewAzureResourceGroupManager() redisCacheManager := resourcemanagerrediscache.NewAzureRedisCacheManager( - ctrl.Log.WithName("rediscachemanager").WithName("RedisCache"), secretClient, scheme, ) diff --git a/pkg/resourcemanager/rediscaches/rediscaches.go b/pkg/resourcemanager/rediscaches/rediscaches.go index c4922fe71b9..f9bf0e4001d 100644 --- a/pkg/resourcemanager/rediscaches/rediscaches.go +++ b/pkg/resourcemanager/rediscaches/rediscaches.go @@ -16,22 +16,19 @@ import ( "github.com/Azure/azure-service-operator/pkg/resourcemanager/iam" "github.com/Azure/azure-service-operator/pkg/secrets" "github.com/Azure/go-autorest/autorest/to" - "github.com/go-logr/logr" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" ) // AzureRedisCacheManager creates a new RedisCacheManager type AzureRedisCacheManager struct { - Log logr.Logger SecretClient secrets.SecretClient Scheme *runtime.Scheme } // NewAzureRedisCacheManager creates a new RedisCacheManager -func NewAzureRedisCacheManager(log logr.Logger, secretClient secrets.SecretClient, scheme *runtime.Scheme) *AzureRedisCacheManager { +func NewAzureRedisCacheManager(secretClient secrets.SecretClient, scheme *runtime.Scheme) *AzureRedisCacheManager { return &AzureRedisCacheManager{ - Log: log, SecretClient: secretClient, Scheme: scheme, } diff --git a/pkg/resourcemanager/rediscaches/suite_test.go b/pkg/resourcemanager/rediscaches/suite_test.go index 770bf37c19c..5f8c782ad1e 100644 --- a/pkg/resourcemanager/rediscaches/suite_test.go +++ b/pkg/resourcemanager/rediscaches/suite_test.go @@ -61,10 +61,8 @@ var _ = BeforeSuite(func() { tc = TestContext{ ResourceGroupName: resourceGroupName, ResourceGroupLocation: resourceGroupLocation, - RedisCacheManager: &AzureRedisCacheManager{ - Log: zaplogger, - }, - ResourceGroupManager: resourceGroupManager, + RedisCacheManager: &AzureRedisCacheManager{}, + ResourceGroupManager: resourceGroupManager, } })