From 919ed29ed9d7336e9f9f2a4f10e7e6bacfbe8f02 Mon Sep 17 00:00:00 2001 From: jananivMS Date: Tue, 31 Mar 2020 15:27:31 -0600 Subject: [PATCH] address PR comments --- .../azure_v1alpha1_eventhubnamespace.yaml | 18 +++++++++--------- pkg/resourcemanager/eventhubs/namespace.go | 16 ++++------------ 2 files changed, 13 insertions(+), 21 deletions(-) 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{}