Compare commits

...

5 Commits

Author SHA1 Message Date
Toomas Pelberg
1aef9baf3b
Merge c5dafb3dbf into 9967e2caab 2026-08-11 23:38:45 +08:00
Gabriele Bartolini
9967e2caab
chore: sync CODEOWNERS with cnpg-infra policy (#1047)
Regenerates this repo's CODEOWNERS from cloudnative-pg/cnpg-infra's
`componentowners-policy.yaml`, the org's tracked desired state for
CODEOWNERS content.

- Routes ownership through this repo's dedicated GitHub owners team
instead of hardcoded usernames, so membership changes are picked up
automatically.
- Any path-scoped rule now also includes the repo's general owners, so a
path rule adds reviewers rather than silently replacing the `*` rule's
owners for that subtree (CODEOWNERS only honors the last matching
pattern, it does not merge).

See cloudnative-pg/cnpg-infra for the policy this is generated from.

Assisted-by: Claude

Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
2026-08-06 19:30:12 +10:00
Toomas Pelberg
c5dafb3dbf
Merge branch 'main' into correct-cluster-serviceaccount 2026-05-25 13:16:53 +03:00
Toomas Pelberg
50c55fd075
Merge branch 'main' into correct-cluster-serviceaccount 2026-05-13 10:06:30 +03:00
Toomas Pelberg
bdf568f48f
Use specified ServiceAccountName in RoleBinding
Signed-off-by: Toomas Pelberg <toomasp@gmx.net>
2026-04-22 15:35:43 +03:00
2 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,9 @@
# The CODEOWNERS file is used to define individuals or teams that are # This file is generated from componentowners-policy.yaml in
# responsible for code in a repository. For details, please refer to # cloudnative-pg/cnpg-infra — do not hand-edit, propose changes there instead.
# https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/about-code-owners #
# Path-scoped rules below always include the repo's own general owners
# (the "*" line) in addition to their own specific teams/users, since
# CODEOWNERS only honors the LAST matching pattern for a given path —
# it does not merge an earlier, less-specific rule into a later one.
* @leonardoce @mnencia @gbartolini @fcanovai @armru @NiccoloFei * @cloudnative-pg/plugin-barman-cloud-owners

View File

@ -126,6 +126,10 @@ func ObjectStoreNamesFromRole(role *rbacv1.Role) []string {
func BuildRoleBinding( func BuildRoleBinding(
cluster *cnpgv1.Cluster, cluster *cnpgv1.Cluster,
) *rbacv1.RoleBinding { ) *rbacv1.RoleBinding {
clusterServiceAccountName := cluster.Name
if cluster.Spec.ServiceAccountName != "" {
clusterServiceAccountName = cluster.Spec.ServiceAccountName
}
return &rbacv1.RoleBinding{ return &rbacv1.RoleBinding{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Namespace: cluster.Namespace, Namespace: cluster.Namespace,
@ -136,7 +140,7 @@ func BuildRoleBinding(
{ {
Kind: "ServiceAccount", Kind: "ServiceAccount",
APIGroup: "", APIGroup: "",
Name: cluster.Name, Name: clusterServiceAccountName,
Namespace: cluster.Namespace, Namespace: cluster.Namespace,
}, },
}, },