diff --git a/config/samples/azure_v1alpha1_eventhubnamespace.yaml b/config/samples/azure_v1alpha1_eventhubnamespace.yaml index 1b311a1c2f8..585f7b19167 100644 --- a/config/samples/azure_v1alpha1_eventhubnamespace.yaml +++ b/config/samples/azure_v1alpha1_eventhubnamespace.yaml @@ -13,12 +13,12 @@ spec: isAutoInflateEnabled: false maximumThroughputUnits: 0 kafkaEnabled: false -#networkRule is only supported on "Standard" tier namespace - networkRule: - defaultAction: deny - virtualNetworkRules: - - subnetId: /subscriptions/{subscription_id}/resourceGroups/{resourcegroup}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{subnet_name} - ignoreMissingServiceEndpoint: true - ipRules: - - ipMask: 1.1.1.1 - - ipMask: 2.2.0.0/24 +#Optional: networkRule is only supported on "Standard" tier namespace +# networkRule: +# defaultAction: deny +# virtualNetworkRules: +# - subnetId: /subscriptions/{subscription_id}/resourceGroups/{resourcegroup}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{subnet_name} +# ignoreMissingServiceEndpoint: true +# ipRules: +# - ipMask: 1.1.1.1 +# - ipMask: 2.2.0.0/24 diff --git a/pkg/resourcemanager/eventhubs/namespace.go b/pkg/resourcemanager/eventhubs/namespace.go index b1b68caa5ba..59929168805 100644 --- a/pkg/resourcemanager/eventhubs/namespace.go +++ b/pkg/resourcemanager/eventhubs/namespace.go @@ -116,22 +116,14 @@ func (_ *azureEventHubNamespaceManager) CreateNamespace(ctx context.Context, res namespaceSku.Capacity = &sku.Capacity } - switch strings.ToLower(sku.Name) { - case "basic": + namespaceSku.Name = eventhub.Standard + if strings.ToLower(sku.Name) == "basic" { namespaceSku.Name = eventhub.Basic - case "standard": - namespaceSku.Name = eventhub.Standard - default: - namespaceSku.Name = eventhub.Standard } - switch strings.ToLower(sku.Tier) { - case "basic": + namespaceSku.Tier = eventhub.SkuTierStandard + if strings.ToLower(sku.Tier) == "basic" { namespaceSku.Tier = eventhub.SkuTierBasic - case "standard": - namespaceSku.Tier = eventhub.SkuTierStandard - default: - namespaceSku.Tier = eventhub.SkuTierStandard } namespaceProperties := eventhub.EHNamespaceProperties{}