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

add namespace to sa error message #2539

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion kubernetes/data_source_kubernetes_service_account_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func dataSourceKubernetesServiceAccountV1Read(ctx context.Context, d *schema.Res
d.SetId(buildId(sa.ObjectMeta))
return nil
}
return diag.Errorf("Unable to fetch service account from Kubernetes: %s", err)
return diag.Errorf(`Unable to fetch service account "%s/%s" from Kubernetes: %s`, metadata.Namespace, metadata.Name, err)
}

defaultSecret, diagMsg := findDefaultServiceAccountV1(ctx, sa, conn)
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/resource_kubernetes_service_account_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func resourceKubernetesServiceAccountV1ImportState(ctx context.Context, d *schem

sa, err := conn.CoreV1().ServiceAccounts(namespace).Get(ctx, name, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("Unable to fetch service account from Kubernetes: %s", err)
return nil, fmt.Errorf(`Unable to fetch service account "%s/%s" from Kubernetes: %s`, namespace, name, err)
}

defaultSecret, diagMsg := findDefaultServiceAccountV1(ctx, sa, conn)
Expand Down
Loading