Przeglądaj źródła

address the concern over boolean name and comment on it for code maintainablity

Signed-off-by: Alan Rodrigues <alanr5691@yahoo.com>
Alan Rodrigues 2 lat temu
rodzic
commit
385dc3edef
2 zmienionych plików z 10 dodań i 1 usunięć
  1. 7 0
      .vscode/launch.json
  2. 3 1
      pkg/cloud/azure/billingexportparser.go

+ 7 - 0
.vscode/launch.json

@@ -0,0 +1,7 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": []
+}

+ 3 - 1
pkg/cloud/azure/billingexportparser.go

@@ -258,7 +258,9 @@ func encloseInBrackets(jsonString string) string {
 	return fmt.Sprintf("{%s}", jsonString)
 }
 
-func AzureSetProviderID(abv *BillingRowValues) (providerID string, isShared bool) {
+// isVMSSShared represents a bool that lets you know while setting providerID we were
+// able to get the actual VMName associated with a VM of a group of VMs in VMSS.
+func AzureSetProviderID(abv *BillingRowValues) (providerID string, isVMSSShared bool) {
 	category := SelectAzureCategory(abv.MeterCategory)
 	if value, ok := abv.AdditionalInfo["VMName"]; ok {
 		return "azure://" + resourceGroupToLowerCase(abv.InstanceID) + getVMNumberForVMSS(fmt.Sprintf("%v", value)), false