Skip to content

Commit

Permalink
Merge pull request #112 from inteon/error_include_clustername
Browse files Browse the repository at this point in the history
Include cluster name in authorization error messages
  • Loading branch information
k8s-ci-robot authored Apr 18, 2024
2 parents db89760 + deecb62 commit 0a35181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/flagutil/kubernetes_cluster_clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,13 @@ func (o *KubernetesOptions) BuildClusterManagers(dryRun bool, requiredTestPodVer
authzClient, err := authorizationv1.NewForConfig(&config)
if err != nil {
lock.Lock()
errs = append(errs, fmt.Errorf("failed to construct authz client: %s", err))
errs = append(errs, fmt.Errorf("failed to construct authz client for cluster %s: %s", name, err))
lock.Unlock()
return
}
if err := CheckAuthorizations(authzClient.SelfSubjectAccessReviews(), options.Namespace, requiredTestPodVerbs); err != nil {
lock.Lock()
errs = append(errs, fmt.Errorf("failed pod resource authorization check: %w", err))
errs = append(errs, fmt.Errorf("failed pod resource authorization check for cluster %s: %w", name, err))
lock.Unlock()
return
}
Expand Down

0 comments on commit 0a35181

Please sign in to comment.