Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rancher: Fix error messages and expose underlying error. #6363

Merged
merged 5 commits into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cluster-autoscaler/cloudprovider/rancher/rancher_nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ func parseResourceAnnotations(annotations map[string]string) (corev1.ResourceLis

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

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

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

return corev1.ResourceList{
Expand Down
Loading