Skip to content

Commit 13c5875

Browse files
authored
Merge pull request #6363 from ElanHasson/patch-1
Rancher: Fix error messages and expose underlying error.
2 parents ffb54c8 + 9ce68ed commit 13c5875

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cluster-autoscaler/cloudprovider/rancher/rancher_nodegroup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ func parseResourceAnnotations(annotations map[string]string) (corev1.ResourceLis
458458

459459
cpuResources, err := resource.ParseQuantity(cpu)
460460
if err != nil {
461-
return nil, fmt.Errorf("unable to parse cpu resources: %s", cpu)
461+
return nil, fmt.Errorf("unable to parse cpu resources: %q: %w", cpu, err)
462462
}
463463
memory, ok := annotations[resourceMemoryAnnotation]
464464
if !ok {
@@ -467,7 +467,7 @@ func parseResourceAnnotations(annotations map[string]string) (corev1.ResourceLis
467467

468468
memoryResources, err := resource.ParseQuantity(memory)
469469
if err != nil {
470-
return nil, fmt.Errorf("unable to parse cpu resources: %s", cpu)
470+
return nil, fmt.Errorf("unable to parse memory resources: %q: %w", memory, err)
471471
}
472472
ephemeralStorage, ok := annotations[resourceEphemeralStorageAnnotation]
473473
if !ok {
@@ -476,7 +476,7 @@ func parseResourceAnnotations(annotations map[string]string) (corev1.ResourceLis
476476

477477
ephemeralStorageResources, err := resource.ParseQuantity(ephemeralStorage)
478478
if err != nil {
479-
return nil, fmt.Errorf("unable to parse cpu resources: %s", cpu)
479+
return nil, fmt.Errorf("unable to parse ephemeral storage resources: %q: %w", ephemeralStorage, err)
480480
}
481481

482482
return corev1.ResourceList{

0 commit comments

Comments
 (0)