Skip to content

Commit ca45276

Browse files
authored
Add Service Account namespace and name to log messages (#2539)
1 parent c042bb6 commit ca45276

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kubernetes/data_source_kubernetes_service_account_v1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func dataSourceKubernetesServiceAccountV1Read(ctx context.Context, d *schema.Res
7474
d.SetId(buildId(sa.ObjectMeta))
7575
return nil
7676
}
77-
return diag.Errorf("Unable to fetch service account from Kubernetes: %s", err)
77+
return diag.Errorf(`Unable to fetch service account "%s/%s" from Kubernetes: %s`, metadata.Namespace, metadata.Name, err)
7878
}
7979

8080
defaultSecret, diagMsg := findDefaultServiceAccountV1(ctx, sa, conn)

kubernetes/resource_kubernetes_service_account_v1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func resourceKubernetesServiceAccountV1ImportState(ctx context.Context, d *schem
421421

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

427427
defaultSecret, diagMsg := findDefaultServiceAccountV1(ctx, sa, conn)

0 commit comments

Comments
 (0)