Repository: replicatedhq/troubleshoot (go)

Issue:
Allocatable memory test fails
I'm attempting to use a test like
```
  - nodeResources:
      checkName: One GB allocatable memory in the cluster
      outcomes:
      - fail:
          when: "sum(memoryAllocatable) < 1Gi"
          message: The cluster must have 1 GB of memory available for allocation.
      - warn:
          when: "sum(memoryAllocatable) < 4Gi"
          message: The cluster is recommended to have 4 GB of memory available for allocation.
      - pass:
          message: There is sufficient memory available for allocation.
```
This is failing, even though when I do `kubectl describe nodes` they all show ~8GB of allocatable memory.

I found several suspicious typos in the code related to this:
- https://github.com/replicatedhq/troubleshoot/blob/master/pkg/analyze/node_resources.go#L255
- https://github.com/replicatedhq/troubleshoot/blob/master/pkg/analyze/node_resources.go#L265

Pull request description:
Fix sum(memoryAllocatable) and sum(podAllocatable)
Fixes `sum(memoryAllocatable)` and `sum(podAllocatable)`. These previously tested the wrong resource (cpuAllocatable).

Also refactor comparison functions to unify resolving properties and add more testing.

Fixes #179.

Patch:
diff --git a/cmd/troubleshoot/cli/run.go b/cmd/troubleshoot/cli/run.go
index 5444b380..ad458378 100644
--- a/cmd/troubleshoot/cli/run.go
+++ b/cmd/troubleshoot/cli/run.go
@@ -47,18 +47,16 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
 		return errors.Wrap(err, "failed to load collector spec")
 	}
 
-	multidocs := strings.Split(string(collectorContent), "---")
-
 	troubleshootclientsetscheme.AddToScheme(scheme.Scheme)
 	decode := scheme.Codecs.UniversalDeserializer().Decode
-	obj, _, err := decode([]byte(multidocs[0]), nil, nil)
+	obj, _, err := decode([]byte(collectorContent), nil, nil)
 	if err != nil {
 		return errors.Wrapf(err, "failed to parse %s", arg)
 	}
 
 	collector := obj.(*troubleshootv1beta1.Collector)
 
-	additionalRedactors := &troubleshootv1beta1.Redactor{}
+	var additionalRedactors *troubleshootv1beta1.Redactor
 	if v.GetString("redactors") != "" {
 		redactorContent, err := loadSpec(v, v.GetString("redactors"))
 		if err != nil {
@@ -75,18 +73,6 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
 		}
 	}
 
-	for i, additionalDoc := range multidocs[1:] {
-		obj, _, err := decode([]byte(additionalDoc), nil, nil)
-		if err != nil {
-			return errors.Wrapf(err, "failed to parse additional doc %d", i)
-		}
-		multidocRedactors, ok := obj.(*troubleshootv1beta1.Redactor)
-		if !ok {
-			continue
-		}
-		additionalRedactors.Spec.Redactors = append(additionalRedactors.Spec.Redactors, multidocRedactors.Spec.Redactors...)
-	}
-
 	s := spin.New()
 	finishedCh := make(chan bool, 1)
 	progressChan := make(chan interface{}, 0) // non-zero buffer can result in missed messages
diff --git a/pkg/analyze/node_resources.go b/pkg/analyze/node_resources.go
index c53273a1..be39c039 100644
--- a/pkg/analyze/node_resources.go
+++ b/pkg/analyze/node_resources.go
@@ -139,25 +139,12 @@ func compareNodeResourceConditionalToActual(conditional string, matchingNodes []
 	switch function {
 	case "count":
 		actualValue = len(matchingNodes)
-		break
 	case "min":
-		av, err := findMin(matchingNodes, property)
-		if err != nil {
-			return false, errors.Wrap(err, "failed to find min")
-		}
-		actualValue = av
+		actualValue = findMin(matchingNodes, property)
 	case "max":
-		av, err := findMax(matchingNodes, property)
-		if err != nil {
-			return false, errors.Wrap(err, "failed to find max")
-		}
-		actualValue = av
+		actualValue = findMax(matchingNodes, property)
 	case "sum":
-		sum, err := findSum(matchingNodes, property)
-		if err != nil {
-			return false, errors.Wrap(err, "failed to find sum")
-		}
-		actualValue = sum
+		actualValue = findSum(matchingNodes, property)
 	}
 
 	switch operator {
@@ -230,223 +217,70 @@ func compareNodeResourceConditionalToActual(conditional string, matchingNodes []
 	return false, errors.New("unexpected conditional in nodeResources")
 }
 
-func findSum(nodes []corev1.Node, property string) (*resource.Quantity, error) {
+func getQuantity(node corev1.Node, property string) *resource.Quantity {
+	switch property {
+	case "cpuCapacity":
+		return node.Status.Capacity.Cpu()
+	case "cpuAllocatable":
+		return node.Status.Allocatable.Cpu()
+	case "memoryCapacity":
+		return node.Status.Capacity.Memory()
+	case "memoryAllocatable":
+		return node.Status.Allocatable.Memory()
+	case "podCapacity":
+		return node.Status.Capacity.Pods()
+	case "podAllocatable":
+		return node.Status.Allocatable.Pods()
+	case "ephemeralStorageCapacity":
+		return node.Status.Capacity.StorageEphemeral()
+	case "ephemeralStorageAllocatable":
+		return node.Status.Allocatable.StorageEphemeral()
+	}
+	return nil
+}
+
+func findSum(nodes []corev1.Node, property string) *resource.Quantity {
 	sum := resource.Quantity{}
 
 	for _, node := range nodes {
-		switch property {
-		case "cpuCapacity":
-			if node.Status.Capacity.Cpu() != nil {
-				sum.Add(*node.Status.Capacity.Cpu())
-			}
-			break
-		case "cpuAllocatable":
-			if node.Status.Allocatable.Cpu() != nil {
-				sum.Add(*node.Status.Allocatable.Cpu())
-			}
-			break
-		case "memoryCapacity":
-			if node.Status.Capacity.Memory() != nil {
-				sum.Add(*node.Status.Capacity.Memory())
-			}
-			break
-		case "memoryAllocatable":
-			if node.Status.Allocatable.Memory() != nil {
-				sum.Add(*node.Status.Allocatable.Cpu())
-			}
-			break
-		case "podCapacity":
-			if node.Status.Capacity.Pods() != nil {
-				sum.Add(*node.Status.Capacity.Pods())
-			}
-			break
-		case "podAllocatable":
-			if node.Status.Allocatable.Pods() != nil {
-				sum.Add(*node.Status.Allocatable.Cpu())
-			}
-			break
-		case "ephemeralStorageCapacity":
-			if node.Status.Capacity.StorageEphemeral() != nil {
-				sum.Add(*node.Status.Capacity.StorageEphemeral())
-			}
-			break
-		case "ephemeralStorageAllocatable":
-			if node.Status.Allocatable.StorageEphemeral() != nil {
-				sum.Add(*node.Status.Allocatable.StorageEphemeral())
-			}
-			break
+		if quant := getQuantity(node, property); quant != nil {
+			sum.Add(*quant)
 		}
 	}
 
-	return &sum, nil
+	return &sum
 }
 
-func findMin(nodes []corev1.Node, property string) (*resource.Quantity, error) {
+func findMin(nodes []corev1.Node, property string) *resource.Quantity {
 	var min *resource.Quantity
 
 	for _, node := range nodes {
-		switch property {
-		case "cpuCapacity":
-			if min == nil {
-				min = node.Status.Capacity.Cpu()
-			} else {
-				if node.Status.Capacity.Cpu().Cmp(*min) == -1 {
-					min = node.Status.Capacity.Cpu()
-				}
-			}
-			break
-		case "cpuAllocatable":
-			if min == nil {
-				min = node.Status.Allocatable.Cpu()
-			} else {
-				if node.Status.Allocatable.Cpu().Cmp(*min) == -1 {
-					min = node.Status.Allocatable.Cpu()
-				}
-			}
-			break
-		case "memoryCapacity":
+		if quant := getQuantity(node, property); quant != nil {
 			if min == nil {
-				min = node.Status.Capacity.Memory()
-			} else {
-				if node.Status.Capacity.Memory().Cmp(*min) == -1 {
-					min = node.Status.Capacity.Memory()
-				}
+				min = quant
+			} else if quant.Cmp(*min) == -1 {
+				min = quant
 			}
-			break
-		case "memoryAllocatable":
-			if min == nil {
-				min = node.Status.Allocatable.Memory()
-			} else {
-				if node.Status.Allocatable.Memory().Cmp(*min) == -1 {
-					min = node.Status.Allocatable.Memory()
-				}
-			}
-			break
-		case "podCapacity":
-			if min == nil {
-				min = node.Status.Capacity.Pods()
-			} else {
-				if node.Status.Capacity.Pods().Cmp(*min) == -1 {
-					min = node.Status.Capacity.Pods()
-				}
-			}
-			break
-		case "podAllocatable":
-			if min == nil {
-				min = node.Status.Allocatable.Pods()
-			} else {
-				if node.Status.Allocatable.Pods().Cmp(*min) == -1 {
-					min = node.Status.Allocatable.Pods()
-				}
-			}
-			break
-		case "ephemeralStorageCapacity":
-			if min == nil {
-				min = node.Status.Capacity.StorageEphemeral()
-			} else {
-				if node.Status.Capacity.StorageEphemeral().Cmp(*min) == -1 {
-					min = node.Status.Capacity.StorageEphemeral()
-				}
-			}
-			break
-		case "ephemeralStorageAllocatable":
-			if min == nil {
-				min = node.Status.Allocatable.StorageEphemeral()
-			} else {
-				if node.Status.Allocatable.StorageEphemeral().Cmp(*min) == -1 {
-					min = node.Status.Allocatable.StorageEphemeral()
-				}
-			}
-			break
-
 		}
 	}
 
-	return min, nil
+	return min
 }
 
-func findMax(nodes []corev1.Node, property string) (*resource.Quantity, error) {
+func findMax(nodes []corev1.Node, property string) *resource.Quantity {
 	var max *resource.Quantity
 
 	for _, node := range nodes {
-		switch property {
-		case "cpuCapacity":
-			if max == nil {
-				max = node.Status.Capacity.Cpu()
-			} else {
-				if node.Status.Capacity.Cpu().Cmp(*max) == 1 {
-					max = node.Status.Capacity.Cpu()
-				}
-			}
-			break
-		case "cpuAllocatable":
-			if max == nil {
-				max = node.Status.Allocatable.Cpu()
-			} else {
-				if node.Status.Allocatable.Cpu().Cmp(*max) == 1 {
-					max = node.Status.Allocatable.Cpu()
-				}
-			}
-			break
-		case "memoryCapacity":
+		if quant := getQuantity(node, property); quant != nil {
 			if max == nil {
-				max = node.Status.Capacity.Memory()
-			} else {
-				if node.Status.Capacity.Memory().Cmp(*max) == 1 {
-					max = node.Status.Capacity.Memory()
-				}
+				max = quant
+			} else if quant.Cmp(*max) == 1 {
+				max = quant
 			}
-			break
-		case "memoryAllocatable":
-			if max == nil {
-				max = node.Status.Allocatable.Memory()
-			} else {
-				if node.Status.Allocatable.Memory().Cmp(*max) == 1 {
-					max = node.Status.Allocatable.Memory()
-				}
-			}
-			break
-		case "podCapacity":
-			if max == nil {
-				max = node.Status.Capacity.Pods()
-			} else {
-				if node.Status.Capacity.Pods().Cmp(*max) == 1 {
-					max = node.Status.Capacity.Pods()
-				}
-			}
-			break
-		case "podAllocatable":
-			if max == nil {
-				max = node.Status.Allocatable.Pods()
-			} else {
-				if node.Status.Allocatable.Pods().Cmp(*max) == 1 {
-					max = node.Status.Allocatable.Pods()
-				}
-			}
-			break
-		case "ephemeralStorageCapacity":
-			if max == nil {
-				max = node.Status.Capacity.StorageEphemeral()
-			} else {
-				if node.Status.Capacity.StorageEphemeral().Cmp(*max) == 1 {
-					max = node.Status.Capacity.StorageEphemeral()
-				}
-			}
-			break
-		case "ephemeralStorageAllocatable":
-			if max == nil {
-				max = node.Status.Allocatable.StorageEphemeral()
-			} else {
-				if node.Status.Allocatable.StorageEphemeral().Cmp(*max) == 1 {
-					max = node.Status.Allocatable.StorageEphemeral()
-				}
-			}
-			break
-
 		}
 	}
 
-	return max, nil
+	return max
 }
 
 func nodeMatchesFilters(node corev1.Node, filters *troubleshootv1beta1.NodeResourceFilters) (bool, error) {
diff --git a/sample-redactors.yaml b/sample-redactors.yaml
new file mode 100644
index 00000000..e7ded8a1
--- /dev/null
+++ b/sample-redactors.yaml
@@ -0,0 +1,13 @@
+apiVersion: troubleshoot.replicated.com/v1beta1
+kind: Redactor
+metadata:
+  name: my-application-name
+spec:
+  redactors:
+  - name: replace password # names are not used internally, but are useful for recordkeeping
+    file: data/my-password-dump # this targets a single file
+    values:
+    - abc123 # this is a very good password, and I don't want it to be exposed
+  - name: all files # as no file is specified, this redactor will run against all files
+    regex:
+    - (another)(?P<mask>.*)(here) # this will replace anything between the strings `another` and `here` with `***HIDDEN***`
diff --git a/sample-troubleshoot.yaml b/sample-troubleshoot.yaml
index 7eb4c421..d5c0ace5 100644
--- a/sample-troubleshoot.yaml
+++ b/sample-troubleshoot.yaml
@@ -18,17 +18,3 @@ spec:
       data: |
         my super secret password is abc123
         another redaction will go here
----
-apiVersion: troubleshoot.replicated.com/v1beta1
-kind: Redactor
-metadata:
-  name: my-application-name
-spec:
-  redactors:
-  - name: replace password # names are not used internally, but are useful for recordkeeping
-    file: data/my-password-dump # this targets a single file
-    values:
-    - abc123 # this is a very good password, and I don't want it to be exposed
-  - name: all files # as no file is specified, this redactor will run against all files
-    regex:
-    - (another)(?P<mask>.*)(here) # this will replace anything between the strings `another` and `here` with `***HIDDEN***`


Test patch:
diff --git a/pkg/analyze/node_resources_test.go b/pkg/analyze/node_resources_test.go
index 166844e0..4ad6496b 100644
--- a/pkg/analyze/node_resources_test.go
+++ b/pkg/analyze/node_resources_test.go
@@ -12,6 +12,55 @@ import (
 )
 
 func Test_compareNodeResourceConditionalToActual(t *testing.T) {
+	nodeData := []corev1.Node{
+		corev1.Node{
+			TypeMeta: metav1.TypeMeta{
+				APIVersion: "v1",
+				Kind:       "Node",
+			},
+			ObjectMeta: metav1.ObjectMeta{
+				Name: "node1",
+			},
+			Status: corev1.NodeStatus{
+				Capacity: corev1.ResourceList{
+					"cpu":               resource.MustParse("2"),
+					"ephemeral-storage": resource.MustParse("20959212Ki"),
+					"memory":            resource.MustParse("3999Ki"),
+					"pods":              resource.MustParse("15"),
+				},
+				Allocatable: corev1.ResourceList{
+					"cpu":               resource.MustParse("1.5"),
+					"ephemeral-storage": resource.MustParse("19316009748"),
+					"memory":            resource.MustParse("16Ki"),
+					"pods":              resource.MustParse("14"),
+				},
+			},
+		},
+		corev1.Node{
+			TypeMeta: metav1.TypeMeta{
+				APIVersion: "v1",
+				Kind:       "Node",
+			},
+			ObjectMeta: metav1.ObjectMeta{
+				Name: "node2",
+			},
+			Status: corev1.NodeStatus{
+				Capacity: corev1.ResourceList{
+					"cpu":               resource.MustParse("4"),
+					"ephemeral-storage": resource.MustParse("10959212Ki"),
+					"memory":            resource.MustParse("7951376Ki"),
+					"pods":              resource.MustParse("29"),
+				},
+				Allocatable: corev1.ResourceList{
+					"cpu":               resource.MustParse("3"),
+					"ephemeral-storage": resource.MustParse("12316009748"),
+					"memory":            resource.MustParse("7848976Ki"),
+					"pods":              resource.MustParse("12"),
+				},
+			},
+		},
+	}
+
 	tests := []struct {
 		name           string
 		conditional    string
@@ -20,576 +69,255 @@ func Test_compareNodeResourceConditionalToActual(t *testing.T) {
 		expected       bool
 	}{
 		{
-			name:        "=",
-			conditional: "= 2",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "=",
+			conditional:    "= 2",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        "count()",
-			conditional: "count() == 2",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "count()",
+			conditional:    "count() == 2",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        "<",
-			conditional: "< 3",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "<",
+			conditional:    "< 3",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        "count() <",
-			conditional: "count() < 3",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "count() <",
+			conditional:    "count() < 3",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        ">",
-			conditional: "> 2",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           ">",
+			conditional:    "> 2",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       false,
 		},
 		{
-			name:        "count() >",
-			conditional: "count() > 1",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "count() >",
+			conditional:    "count() > 1",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        "count() >= 1 (true)",
-			conditional: "count() > 1",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "count() >= 1 (true)",
+			conditional:    "count() > 1",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        "count() <= 2 (true)",
-			conditional: "count() <= 2",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "count() <= 2 (true)",
+			conditional:    "count() <= 2",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        "count() <= 1 (false)",
-			conditional: "count() <= 1",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "count() <= 1 (false)",
+			conditional:    "count() <= 1",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       false,
 		},
 		{
-			name:        "min(memoryCapacity) <= 4Gi (true)",
-			conditional: "min(memoryCapacity) <= 4Gi",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("3999Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("16Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("7951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "min(memoryCapacity) < 4Gi (true)",
+			conditional:    "min(memoryCapacity) < 4Gi",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        "min(memoryCapacity) <= 4Gi (false)",
-			conditional: "min(memoryCapacity) <= 4Gi",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("17951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("7951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "min(memoryCapacity) >= 4Gi (false)",
+			conditional:    "min(memoryCapacity) >= 4Gi",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       false,
 		},
 		{
-			name:        "max(cpuCapacity) == 12 (false)",
-			conditional: "max(cpuCapacity) == 12",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("17951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("7951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "min(memoryAllocatable) == 16Ki (true)",
+			conditional:    "min(memoryAllocatable) == 16Ki",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "min(cpuCapacity) == 2 (true)",
+			conditional:    "min(cpuCapacity) == 2",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "min(cpuAllocatable) == 1.5 (true)",
+			conditional:    "min(cpuAllocatable) == 1.5",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "min(podCapacity) == 15 (true)",
+			conditional:    "min(podCapacity) == 15",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "min(podAllocatable) == 12 (true)",
+			conditional:    "min(podAllocatable) == 12",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "min(ephemeralStorageCapacity) <= 20Gi (true)",
+			conditional:    "min(ephemeralStorageCapacity) <= 20Gi",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "min(ephemeralStorageCapacity) > 20Gi (false)",
+			conditional:    "min(ephemeralStorageCapacity) > 20Gi",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       false,
 		},
 		{
-			name:        "max(cpuCapacity) == 2 (true)",
-			conditional: "max(cpuCapacity) == 2",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("17951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("7951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("2"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "min(ephemeralStorageAllocatable) == 12316009748 (true)",
+			conditional:    "min(ephemeralStorageAllocatable) == 12316009748",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 		{
-			name:        "sum(cpuCapacity) > 32 (true)",
-			conditional: "sum(cpuCapacity) > 32",
-			matchingNodes: []corev1.Node{
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node1",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("17951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node2",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("7951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node3",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("7951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node4",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("7951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-				corev1.Node{
-					TypeMeta: metav1.TypeMeta{
-						APIVersion: "v1",
-						Kind:       "Node",
-					},
-					ObjectMeta: metav1.ObjectMeta{
-						Name: "node5",
-					},
-					Status: corev1.NodeStatus{
-						Capacity: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("20959212Ki"),
-							"memory":            resource.MustParse("7951376Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-						Allocatable: corev1.ResourceList{
-							"cpu":               resource.MustParse("8"),
-							"ephemeral-storage": resource.MustParse("19316009748"),
-							"memory":            resource.MustParse("7848976Ki"),
-							"pods":              resource.MustParse("29"),
-						},
-					},
-				},
-			},
-			totalNodeCount: 2,
+			name:           "max(memoryCapacity) == 7951376Ki (true)",
+			conditional:    "max(memoryCapacity) == 7951376Ki",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "max(memoryAllocatable) == 7848976Ki (true)",
+			conditional:    "max(memoryAllocatable) == 7848976Ki",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "max(cpuCapacity) == 12 (false)",
+			conditional:    "max(cpuCapacity) == 12",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       false,
+		},
+		{
+			name:           "max(cpuCapacity) == 4 (true)",
+			conditional:    "max(cpuCapacity) == 4",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "max(cpuAllocatable) == 3 (true)",
+			conditional:    "max(cpuAllocatable) == 3",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "max(podCapacity) == 29 (true)",
+			conditional:    "max(podCapacity) == 29",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "max(podAllocatable) == 14 (true)",
+			conditional:    "max(podAllocatable) == 14",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "max(ephemeralStorageCapacity) == 20959212Ki (true)",
+			conditional:    "max(ephemeralStorageCapacity) == 20959212Ki",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "max(ephemeralStorageAllocatable) == 19316009748 (true)",
+			conditional:    "max(ephemeralStorageAllocatable) == 19316009748",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "sum(memoryCapacity) > 7951376Ki (true)",
+			conditional:    "sum(memoryCapacity) > 7951376Ki",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "sum(memoryAllocatable) > 7848976Ki (true)",
+			conditional:    "sum(memoryAllocatable) > 7848976Ki",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "sum(cpuCapacity) > 5 (true)",
+			conditional:    "sum(cpuCapacity) > 5",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "sum(cpuAllocatable) == 4.5 (true)",
+			conditional:    "sum(cpuAllocatable) == 4.5",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "sum(podCapacity) == 44 (true)",
+			conditional:    "sum(podCapacity) == 44",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "sum(podAllocatable) == 26 (true)",
+			conditional:    "sum(podAllocatable) == 26",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "sum(ephemeralStorageCapacity) > 20959212Ki (true)",
+			conditional:    "sum(ephemeralStorageCapacity) > 20959212Ki",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
+			expected:       true,
+		},
+		{
+			name:           "sum(ephemeralStorageAllocatable) > 19316009748 (true)",
+			conditional:    "sum(ephemeralStorageAllocatable) > 19316009748",
+			matchingNodes:  nodeData,
+			totalNodeCount: len(nodeData),
 			expected:       true,
 		},
 	}
@@ -608,6 +336,29 @@ func Test_compareNodeResourceConditionalToActual(t *testing.T) {
 }
 
 func Test_nodeMatchesFilters(t *testing.T) {
+	node := corev1.Node{
+		Status: corev1.NodeStatus{
+			Capacity: corev1.ResourceList{
+				"attachable-volumes-aws-ebs": resource.MustParse("25"),
+				"cpu":                        resource.MustParse("2"),
+				"ephemeral-storage":          resource.MustParse("20959212Ki"),
+				"hugepages-1Gi":              resource.MustParse("0"),
+				"hugepages-2Mi":              resource.MustParse("0"),
+				"memory":                     resource.MustParse("7951376Ki"),
+				"pods":                       resource.MustParse("29"),
+			},
+			Allocatable: corev1.ResourceList{
+				"attachable-volumes-aws-ebs": resource.MustParse("25"),
+				"cpu":                        resource.MustParse("2"),
+				"ephemeral-storage":          resource.MustParse("19316009748"),
+				"hugepages-1Gi":              resource.MustParse("0"),
+				"hugepages-2Mi":              resource.MustParse("0"),
+				"memory":                     resource.MustParse("7848976Ki"),
+				"pods":                       resource.MustParse("29"),
+			},
+		},
+	}
+
 	tests := []struct {
 		name         string
 		node         corev1.Node
@@ -615,82 +366,19 @@ func Test_nodeMatchesFilters(t *testing.T) {
 		expectResult bool
 	}{
 		{
-			name: "true when empty filters",
-			node: corev1.Node{
-				Status: corev1.NodeStatus{
-					Capacity: corev1.ResourceList{
-						"attachable-volumes-aws-ebs": resource.MustParse("25"),
-						"cpu":                        resource.MustParse("2"),
-						"ephemeral-storage":          resource.MustParse("20959212Ki"),
-						"hugepages-1Gi":              resource.MustParse("0"),
-						"hugepages-2Mi":              resource.MustParse("0"),
-						"memory":                     resource.MustParse("7951376Ki"),
-						"pods":                       resource.MustParse("29"),
-					},
-					Allocatable: corev1.ResourceList{
-						"attachable-volumes-aws-ebs": resource.MustParse("25"),
-						"cpu":                        resource.MustParse("2"),
-						"ephemeral-storage":          resource.MustParse("19316009748"),
-						"hugepages-1Gi":              resource.MustParse("0"),
-						"hugepages-2Mi":              resource.MustParse("0"),
-						"memory":                     resource.MustParse("7848976Ki"),
-						"pods":                       resource.MustParse("29"),
-					},
-				},
-			},
+			name:         "true when empty filters",
+			node:         node,
 			filters:      &troubleshootv1beta1.NodeResourceFilters{},
 			expectResult: true,
 		},
 		{
-			name: "true while nil/missing filters",
-			node: corev1.Node{
-				Status: corev1.NodeStatus{
-					Capacity: corev1.ResourceList{
-						"attachable-volumes-aws-ebs": resource.MustParse("25"),
-						"cpu":                        resource.MustParse("2"),
-						"ephemeral-storage":          resource.MustParse("20959212Ki"),
-						"hugepages-1Gi":              resource.MustParse("0"),
-						"hugepages-2Mi":              resource.MustParse("0"),
-						"memory":                     resource.MustParse("7951376Ki"),
-						"pods":                       resource.MustParse("29"),
-					},
-					Allocatable: corev1.ResourceList{
-						"attachable-volumes-aws-ebs": resource.MustParse("25"),
-						"cpu":                        resource.MustParse("2"),
-						"ephemeral-storage":          resource.MustParse("19316009748"),
-						"hugepages-1Gi":              resource.MustParse("0"),
-						"hugepages-2Mi":              resource.MustParse("0"),
-						"memory":                     resource.MustParse("7848976Ki"),
-						"pods":                       resource.MustParse("29"),
-					},
-				},
-			},
+			name:         "true while nil/missing filters",
+			node:         node,
 			expectResult: true,
 		},
 		{
 			name: "false when allocatable memory is too high",
-			node: corev1.Node{
-				Status: corev1.NodeStatus{
-					Capacity: corev1.ResourceList{
-						"attachable-volumes-aws-ebs": resource.MustParse("25"),
-						"cpu":                        resource.MustParse("2"),
-						"ephemeral-storage":          resource.MustParse("20959212Ki"),
-						"hugepages-1Gi":              resource.MustParse("0"),
-						"hugepages-2Mi":              resource.MustParse("0"),
-						"memory":                     resource.MustParse("7951376Ki"),
-						"pods":                       resource.MustParse("29"),
-					},
-					Allocatable: corev1.ResourceList{
-						"attachable-volumes-aws-ebs": resource.MustParse("25"),
-						"cpu":                        resource.MustParse("2"),
-						"ephemeral-storage":          resource.MustParse("19316009748"),
-						"hugepages-1Gi":              resource.MustParse("0"),
-						"hugepages-2Mi":              resource.MustParse("0"),
-						"memory":                     resource.MustParse("7848976Ki"),
-						"pods":                       resource.MustParse("29"),
-					},
-				},
-			},
+			node: node,
 			filters: &troubleshootv1beta1.NodeResourceFilters{
 				MemoryAllocatable: "16Gi",
 			},
@@ -698,32 +386,11 @@ func Test_nodeMatchesFilters(t *testing.T) {
 		},
 		{
 			name: "true when allocatable memory is available",
-			node: corev1.Node{
-				Status: corev1.NodeStatus{
-					Capacity: corev1.ResourceList{
-						"attachable-volumes-aws-ebs": resource.MustParse("25"),
-						"cpu":                        resource.MustParse("2"),
-						"ephemeral-storage":          resource.MustParse("20959212Ki"),
-						"hugepages-1Gi":              resource.MustParse("0"),
-						"hugepages-2Mi":              resource.MustParse("0"),
-						"memory":                     resource.MustParse("7951376Ki"),
-						"pods":                       resource.MustParse("29"),
-					},
-					Allocatable: corev1.ResourceList{
-						"attachable-volumes-aws-ebs": resource.MustParse("25"),
-						"cpu":                        resource.MustParse("2"),
-						"ephemeral-storage":          resource.MustParse("19316009748"),
-						"hugepages-1Gi":              resource.MustParse("0"),
-						"hugepages-2Mi":              resource.MustParse("0"),
-						"memory":                     resource.MustParse("7848976Ki"),
-						"pods":                       resource.MustParse("29"),
-					},
-				},
-			},
+			node: node,
 			filters: &troubleshootv1beta1.NodeResourceFilters{
-				MemoryAllocatable: "8Gi",
+				MemoryAllocatable: "4Gi",
 			},
-			expectResult: false,
+			expectResult: true,
 		},
 	}