From 421942eab99055b2c1da3efc62368d4f654bc3c1 Mon Sep 17 00:00:00 2001 From: jpflueger Date: Sun, 19 Apr 2020 23:52:27 -0600 Subject: [PATCH] removing diagnostic logging --- controllers/cosmosdb_controller_test.go | 20 -------------- .../cosmosdbs/cosmosdb_reconcile.go | 26 ------------------- 2 files changed, 46 deletions(-) diff --git a/controllers/cosmosdb_controller_test.go b/controllers/cosmosdb_controller_test.go index 7b5aaa31c7a..31ad06cb5e7 100644 --- a/controllers/cosmosdb_controller_test.go +++ b/controllers/cosmosdb_controller_test.go @@ -7,7 +7,6 @@ package controllers import ( "context" - "log" "testing" "github.com/Azure/azure-service-operator/api/v1alpha1" @@ -49,25 +48,6 @@ func TestCosmosDBHappyPath(t *testing.T) { assert.Eventually(func() bool { secret, err := tc.secretClient.Get(ctx, key) - cond := err == nil && len(secret) > 0 - if !cond { - //TODO: remove before completing pull request - tc.k8sClient.Get(ctx, key, dbInstance) - log.Printf( - `----- COSMOSDB ----- - Secret: %v - Assertion: %v - Error: %v - Secret: %v - Status: %v - `, - key, - cond, - err, - secret, - dbInstance.Status, - ) - } return err == nil && len(secret) > 0 }, tc.timeoutFast, tc.retry, "wait for cosmosdb to have secret") diff --git a/pkg/resourcemanager/cosmosdbs/cosmosdb_reconcile.go b/pkg/resourcemanager/cosmosdbs/cosmosdb_reconcile.go index 18ec817e172..bd44b45a448 100644 --- a/pkg/resourcemanager/cosmosdbs/cosmosdb_reconcile.go +++ b/pkg/resourcemanager/cosmosdbs/cosmosdb_reconcile.go @@ -6,7 +6,6 @@ package cosmosdbs import ( "context" "fmt" - "log" "strings" "github.com/Azure/azure-service-operator/api/v1alpha1" @@ -67,8 +66,6 @@ func (m *AzureCosmosDBManager) Ensure(ctx context.Context, obj runtime.Object, o } if instance.Status.State == "Succeeded" { - log.Println("Hit Get success path") - // provisioning is complete, update the secrets if err = m.createOrUpdateAccountKeysSecret(ctx, instance); err != nil { instance.Status.Message = err.Error() @@ -76,7 +73,6 @@ func (m *AzureCosmosDBManager) Ensure(ctx context.Context, obj runtime.Object, o } if instance.Status.SpecHash == hash { - log.Println("Hit Get + SpecHash success path") instance.Status.Message = resourcemanager.SuccessMsg instance.Status.Provisioning = false instance.Status.Provisioned = true @@ -129,7 +125,6 @@ func (m *AzureCosmosDBManager) Ensure(ctx context.Context, obj runtime.Object, o } } - log.Printf("Hit unhandled error case: %v\n", err) return false, err } @@ -138,7 +133,6 @@ func (m *AzureCosmosDBManager) Ensure(ctx context.Context, obj runtime.Object, o return false, err } - log.Println("Hit terminal success case.") instance.Status.SpecHash = hash instance.Status.ResourceId = *db.ID instance.Status.State = *db.ProvisioningState @@ -240,15 +234,6 @@ func (m *AzureCosmosDBManager) convert(obj runtime.Object) (*v1alpha1.CosmosDB, func (m *AzureCosmosDBManager) createOrUpdateAccountKeysSecret(ctx context.Context, instance *v1alpha1.CosmosDB) error { result, err := m.ListKeys(ctx, instance.Spec.ResourceGroup, instance.ObjectMeta.Name) if err != nil { - //TODO: remove before completing pull request - log.Printf( - `Failed to list CosmosDB Account Keys: - Status: %v - Error: %v - `, - instance.Status, - err, - ) return err } @@ -265,20 +250,9 @@ func (m *AzureCosmosDBManager) createOrUpdateAccountKeysSecret(ctx context.Conte err = m.SecretClient.Upsert(ctx, secretKey, secretData) if err != nil { - //TODO: remove before completing pull request - log.Printf( - `Failed to upsert CosmosDB Account Keys: - Status: %v - Error: %v - `, - instance.Status, - err, - ) return err } - //TODO: remove before completing pull request - log.Printf("Successfully upserted CosmosDB Account Keys: %v\n", secretKey) return nil }