From 4eb97886b7787a6e02027667cca5b9b45b23e8ca Mon Sep 17 00:00:00 2001 From: Janani Vasudevan <49576785+jananivMS@users.noreply.github.com> Date: Fri, 30 Aug 2019 15:48:13 -0600 Subject: [PATCH] Fix issues in Azure SQL branch (#170) * feat: implement keyvault controller * Ace's KV changes with updates * Added an event for the final successful provisioning * Updated changes based on the PR comments * removing unwanted file * making resource group name the one in the keyvault yaml * need to handled unexpected error types...like validation.error (#111) * refactor tests (#90) * improve tests with parallel execution and rm sleep * fix the tests to run on kindcluster * Updates to KV controller from Ace (#80) (#112) * feat: implement keyvault controller * Ace's KV changes with updates * Added an event for the final successful provisioning * Updated changes based on the PR comments * removing unwanted file * making resource group name the one in the keyvault yaml Co-authored-by: Ace Eldeib * Test update (#115) * this needs to exist in the reconciler in order to use controllerutil createorupdate * Feat/add consumer group kind (#117) * add consumer group kind * update tests for consumer group * fix isbeingdeleted * Updates to README - steps for onboarding (#114) * cluster additions * updated docs * Update azure-pipelines.yaml (#119) * Update azure-pipelines.yaml * fix tests (#140) * revert back // +kubebuilder:subresource:status changes - fix broken tests * Devcontainer to Help Onboard New People (#142) * add dev conatiner - wip * DevContainer up and running. * Removed `sleep 80` and replaced with `kubectl wait`. * Run `make set-kindcluster` from docker-compose. * Set timeout on wait. * Added `install-test-dependency` to makefile and dockerfile. * Update README - Create SP with contribution rights. * Updated README with details on using devcontainer. * Stuff that wanted me to commit. * Reverted changes made to `docker-build` in Makefile. * pass future where possible instead of bool (#121) * first commit on Amanda's branch * first * before properties * test not tested * test works * unit tests work, needs firewall rules * addresses feedback * erin's feedback * janani's change, pass future * async works much better now * janani feedback * screwed up interface prototype * randomize the resources names used in tests (#152) * Ability to Set SecretName When Creating Event Hub (#151) * Updated eventhub_types - Added `secretName`. * Added `secretName` to sample manifest. * Set secret name to `secretName` if set, otherwise use eventhub name. * Updated Makefile to update Azure Operator. Also added the ability to rebuild image without cache. * Updated README on how to update the Azure Operator. * Updated CRD with SecretName description. * Added tests to ensure `SecretName` was being used if present. * Fix test. * merging * fixed issues with merge conflict Please enter the commit message for your changes. Lines starting * fixing merge conflict markers in role yaml * removing file * Fixed issues in the SDK library to take location from the spec instead of config and the error library. Please enter the commit message for your changes. Lines starting --- pkg/errhelp/errors.go | 4 ++++ pkg/resourcemanager/sqlclient/sqlclient_godsk.go | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/errhelp/errors.go b/pkg/errhelp/errors.go index 122cebf37ba..7b148af36a7 100644 --- a/pkg/errhelp/errors.go +++ b/pkg/errhelp/errors.go @@ -14,6 +14,10 @@ const ( ) func NewAzureError(err error) error { + + if err == nil { + return nil + } ae := AzureError{ Original: err, } diff --git a/pkg/resourcemanager/sqlclient/sqlclient_godsk.go b/pkg/resourcemanager/sqlclient/sqlclient_godsk.go index 072638344d4..a6fad539b4a 100644 --- a/pkg/resourcemanager/sqlclient/sqlclient_godsk.go +++ b/pkg/resourcemanager/sqlclient/sqlclient_godsk.go @@ -64,7 +64,7 @@ func (sdk GoSDKClient) CreateOrUpdateSQLServer(properties SQLServerProperties) ( sdk.ResourceGroupName, sdk.ServerName, sql.Server{ - Location: to.StringPtr(config.Location()), + Location: to.StringPtr(sdk.Location), ServerProperties: &serverProp, }) if err != nil { @@ -257,7 +257,7 @@ func (sdk GoSDKClient) GetServer(rgroup, name string) (sql.Server, error) { return serversClient.Get( sdk.Ctx, - sdk.ResourceGroupName, - sdk.ServerName, + rgroup, + name, ) }