Skip to content

Commit

Permalink
adding temporary logging to diagnose CI test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jpflueger committed Apr 17, 2020
1 parent be01200 commit 4fc8814
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion pkg/resourcemanager/cosmosdbs/cosmosdb_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cosmosdbs
import (
"context"
"fmt"
"log"
"strings"

"github.com/Azure/azure-service-operator/api/v1alpha1"
Expand Down Expand Up @@ -226,6 +227,15 @@ 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
}

Expand All @@ -240,7 +250,21 @@ func (m *AzureCosmosDBManager) createOrUpdateAccountKeysSecret(ctx context.Conte
"secondaryReadonlyMasterKey": []byte(*result.SecondaryReadonlyMasterKey),
}

return m.SecretClient.Upsert(ctx, secretKey, secretData)
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
}

return nil
}

func (m *AzureCosmosDBManager) deleteAccountKeysSecret(ctx context.Context, instance *v1alpha1.CosmosDB) error {
Expand Down

0 comments on commit 4fc8814

Please sign in to comment.