Skip to content

Commit

Permalink
AVX-51277: Do not set bucket_name for config backup in Azure.
Browse files Browse the repository at this point in the history
On the controller we have a bound validator that ensures that the `bucket_name`
parameter is non-empty.  When we send a request to backup configuration for
Azure, we use a set of different parameters and we do not set `bucket_name`.
This causes validation to fail for Azure.
  • Loading branch information
dnardo committed Mar 5, 2024
1 parent 7485a2e commit 40ef2bd
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions goaviatrix/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,22 @@ func (c *Client) GetSecurityGroupManagementStatus() (*SecurityGroupInfo, error)

func (c *Client) EnableCloudnBackupConfig(cloudnBackupConfiguration *CloudnBackupConfiguration) error {
form := map[string]string{
"CID": c.CID,
"action": "enable_cloudn_backup_config",
"cloud_type": strconv.Itoa(cloudnBackupConfiguration.BackupCloudType),
"acct_name": cloudnBackupConfiguration.BackupAccountName,
"bucket_name": cloudnBackupConfiguration.BackupBucketName,
"storage_name": cloudnBackupConfiguration.BackupStorageName,
"container_name": cloudnBackupConfiguration.BackupContainerName,
"region": cloudnBackupConfiguration.BackupRegion,
"CID": c.CID,
"action": "enable_cloudn_backup_config",
"cloud_type": strconv.Itoa(cloudnBackupConfiguration.BackupCloudType),
"acct_name": cloudnBackupConfiguration.BackupAccountName,
"region": cloudnBackupConfiguration.BackupRegion,
}
// Azure has a set of different parameters that must be set.
if cloudnBackupConfiguration.BackupCloudType == Azure ||
cloudnBackupConfiguration.BackupCloudType == AzureGov ||
cloudnBackupConfiguration.BackupCloudType == AzureChina {
form["storage_name"] = cloudnBackupConfiguration.BackupStorageName
form["container_name"] = cloudnBackupConfiguration.BackupContainerName
} else {
form["bucket_name"] = cloudnBackupConfiguration.BackupBucketName
}

if cloudnBackupConfiguration.MultipleBackups == "true" {
form["multiple_bkup"] = "true"
}
Expand Down

0 comments on commit 40ef2bd

Please sign in to comment.