Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jananivMS committed Jan 5, 2020
1 parent cbd70ca commit bbe9df5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/resourcemanager/azuresql/azuresqlserver/azuresqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ func (_ *AzureSqlServerManager) GetServer(ctx context.Context, resourceGroupName
}

// CreateOrUpdateSQLServer creates a SQL server in Azure
func (_ *AzureSqlServerManager) CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties azuresqlshared.SQLServerProperties, fUpdateWithoutCheckingName bool) (result sql.Server, err error) {
func (_ *AzureSqlServerManager) CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties azuresqlshared.SQLServerProperties, forceUpdate bool) (result sql.Server, err error) {
serversClient := azuresqlshared.GetGoServersClient()
serverProp := azuresqlshared.SQLServerPropertiesToServer(properties)

if fUpdateWithoutCheckingName == false {
if forceUpdate == false {
checkNameResult, _ := CheckNameAvailability(ctx, resourceGroupName, serverName)
if checkNameResult.Reason == sql.AlreadyExists {
return result, errors.New("AlreadyExists")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

type SqlServerManager interface {
CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties azuresqlshared.SQLServerProperties, fUpdateWithoutCheckingName bool) (result sql.Server, err error)
CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties azuresqlshared.SQLServerProperties, forceUpdate bool) (result sql.Server, err error)
DeleteSQLServer(ctx context.Context, resourceGroupName string, serverName string) (result autorest.Response, err error)
GetServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.Server, err error)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// ResourceClient contains the helper functions for interacting with SQL servers / databases
type ResourceClient interface {
CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties SQLServerProperties, fUpdateWithoutCheckingName bool) (result sql.Server, err error)
CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties SQLServerProperties, forceUpdate bool) (result sql.Server, err error)
DeleteSQLServer(ctx context.Context, resourceGroupName string, serverName string) (result autorest.Response, err error)
GetServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.Server, err error)
DeleteSQLFirewallRule(ctx context.Context, resourceGroupName string, serverName string, ruleName string) (err error)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/mock/azuresql/azuresqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func findSqlServer(res []MockSqlServerResource, predicate func(MockSqlServerReso
}

// CreateOrUpdateSqlServer creates a new sql server
func (manager *MockSqlServerManager) CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties azuresqlshared.SQLServerProperties, fUpdateWithoutCheckingName bool) (result sql.Server, err error) {
func (manager *MockSqlServerManager) CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties azuresqlshared.SQLServerProperties, forceUpdate bool) (result sql.Server, err error) {
index, _ := findSqlServer(manager.sqlServers, func(s MockSqlServerResource) bool {
return s.resourceGroupName == resourceGroupName && *s.sqlServer.Name == serverName
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/resourcemanager/mock/sqlclient/sqlclient_gosdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type MockGoSDKClient struct {
}

// CreateOrUpdateSQLServer creates a new sql server
func (sdk *MockGoSDKClient) CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties azuresqlshared.SQLServerProperties, fUpdateWithoutCheckingName bool) (result sql.Server, err error) {
func (sdk *MockGoSDKClient) CreateOrUpdateSQLServer(ctx context.Context, resourceGroupName string, location string, serverName string, properties azuresqlshared.SQLServerProperties, forceUpdate bool) (result sql.Server, err error) {
var sqlServer = sql.Server{
Response: helpers.GetRestResponse(http.StatusCreated),
}
Expand Down

0 comments on commit bbe9df5

Please sign in to comment.