Skip to content

Commit 0cef449

Browse files
committed
fix: obs sas token validation
1 parent 1dd0a67 commit 0cef449

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ proxy_url = VALUE
468468
| <a name="input_function_app_storage_account_prefix"></a> [function\_app\_storage\_account\_prefix](#input\_function\_app\_storage\_account\_prefix) | Weka storage account name prefix | `string` | `"weka"` | no |
469469
| <a name="input_function_app_subnet_delegation_cidr"></a> [function\_app\_subnet\_delegation\_cidr](#input\_function\_app\_subnet\_delegation\_cidr) | Subnet delegation enables you to designate a specific subnet for an Azure PaaS service. | `string` | `"10.0.1.0/25"` | no |
470470
| <a name="input_function_app_subnet_delegation_id"></a> [function\_app\_subnet\_delegation\_id](#input\_function\_app\_subnet\_delegation\_id) | Required to specify if subnet\_name were used to specify pre-defined subnets for weka. Function subnet delegation requires an additional subnet, and in the case of pre-defined networking this one also should be pre-defined | `string` | `""` | no |
471-
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"875b29685e79d1d332c01d02e42eb6ed"` | no |
471+
| <a name="input_function_app_version"></a> [function\_app\_version](#input\_function\_app\_version) | Function app code version (hash) | `string` | `"0b29f922e1f847a5ca6055cc55ec4c24"` | no |
472472
| <a name="input_get_weka_io_token"></a> [get\_weka\_io\_token](#input\_get\_weka\_io\_token) | The token to download the Weka release from get.weka.io. | `string` | `""` | no |
473473
| <a name="input_hotspare"></a> [hotspare](#input\_hotspare) | Number of hotspares to set on weka cluster. Refer to https://docs.weka.io/weka-system-overview/ssd-capacity-management#hot-spare | `number` | `1` | no |
474474
| <a name="input_install_cluster_dpdk"></a> [install\_cluster\_dpdk](#input\_install\_cluster\_dpdk) | Install weka cluster with DPDK | `bool` | `true` | no |

function-app/code/functions/clusterize/clusterize.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ func PrepareWekaObs(ctx context.Context, p *ClusterizationParams) (err error) {
8585

8686
noExistingObs := p.Obs.AccessKey == ""
8787

88-
if noExistingObs && p.Obs.Name != "" {
89-
return fmt.Errorf("OBS misconfiguration: access key must be provided when creating a new OBS")
90-
}
91-
9288
if p.Obs.NetworkAccess == "Disabled" && noExistingObs && !p.CreateBlobPrivateEndpoint {
9389
return fmt.Errorf("private endpoint creation is required for obs when public access is disabled")
9490
}

functions.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,11 @@ resource "azurerm_linux_function_app" "function_app" {
343343
condition = var.install_weka_url != "" || var.weka_version != ""
344344
error_message = "Please provide either 'install_weka_url' or 'weka_version' variables."
345345
}
346+
347+
precondition {
348+
condition = !var.tiering_enable_obs_integration || var.tiering_obs_name == "" || var.tiering_blob_obs_access_key != ""
349+
error_message = "OBS misconfiguration: access key must be provided when tiering_obs_name is set"
350+
}
346351
}
347352

348353
depends_on = [module.network, module.iam, azurerm_storage_account.deployment_sa, azurerm_private_endpoint.file_endpoint, azurerm_private_endpoint.blob_endpoint]

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ variable "function_app_storage_account_container_prefix" {
410410
variable "function_app_version" {
411411
type = string
412412
description = "Function app code version (hash)"
413-
default = "875b29685e79d1d332c01d02e42eb6ed"
413+
default = "0b29f922e1f847a5ca6055cc55ec4c24"
414414
}
415415

416416
variable "function_app_dist" {

0 commit comments

Comments
 (0)