Skip to content

Conversation

@tomasaschan
Copy link
Member

Before this change, the file name of the role/clusterrole generated from +rbac markers was hardcoded to role.yaml.

This change introduces a parameter fileName to the RBAC generator, so that one can do

controller-gen rbac:fileName=my-rbac-my-choice.yaml 

and have the file be my-rbac-my-choice.yaml instead. (Given no specified output in the above example, the full path of the output file will be /config/rbac/my-rbac-my-choice.yaml.)

This is useful e.g. in cases where the target directory structure is not the standard Kustomize-packaged Kubebuilder one, but instead e.g. a Helm chart where multiple sources of information may contribute to the final set of files.

Before this change, the file name of the role/clusterrole generated from `+rbac` markers was hardcoded to `role.yaml`. This change introduces a parameter `fileName` to the RBAC generator, so that one can do ``` controller-gen rbac:fileName=my-rbac-my-choice.yaml ``` and have the file be `my-rbac-my-choice.yaml` instead. (Given no specified `output` in the above example, the full path of the output file will be `/config/rbac/my-rbac-my-choice.yaml`.) This is useful e.g. in cases where the target directory structure is not the standard Kustomize-packaged Kubebuilder one, but instead e.g. a Helm chart where multiple sources of information may contribute to the final set of files.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 13, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, tomasaschan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 16, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: cc395b831ca01fa691ae86092b61be6cd6780a6c

@k8s-ci-robot k8s-ci-robot merged commit 23dd517 into kubernetes-sigs:main Apr 16, 2025
9 checks passed
@tomasaschan tomasaschan deleted the parametrize-rbac-filename branch April 16, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

3 participants