-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
✨ config-gen create and bind to a non-default service account #2085
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pwittrock 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 |
pkg/cli/alpha/config-gen/templates/resources/service-account.template.yaml
Outdated
Show resolved
Hide resolved
pkg/cli/alpha/config-gen/testdata/serviceaccountgenerate/config.yaml
Outdated
Show resolved
Hide resolved
PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, we are using a fixed name for the ServiceAccount
and then prefixing it with a unique prefix per manager. This approach is a bit different, unsing a user-provided name and defaulting to the KubebuilderConfigGen
name.
I don't have a strong opinion on which approach is better. @estroz?
pkg/cli/alpha/config-gen/cmd.go
Outdated
# configure the service account used for RBAC | ||
name: foo | ||
|
||
# generate the service account resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found at least these 4 tabs
# configure the service account used for RBAC | |
name: foo | |
# generate the service account resource | |
# configure the service account used for RBAC | |
name: foo | |
# generate the service account resource |
pkg/cli/alpha/config-gen/cmd.go
Outdated
serviceAccount: | ||
# configure the service account used for RBAC | ||
name: foo | ||
|
||
# generate the service account resource | ||
generate: true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate?
@Adirio correct. @pwittrock it seems some resources are generated with their final name, and some do not have a name prefix such that they can be |
What is the issue that keeps nameprefix from working? This could be an issue with the transformer plugin ordering -- does it work if you use the plugin as a base for the kustomization that does the prefix? |
I suspect this is in part because of kustomize's inability to finely configure name transformations -- e.g. Kustomize doesn't allow a user to provide a name and then generate names from that, it only supports adding either a prefix or suffix. |
@pwittrock nothing necessarily, I'm just wondering why some templates are generated with their final name and some are not such that kustomize can prefix their name. Shouldn't they all be prefixed by kustomize, or all templates have the final name, ex.
It seems kustomize does not apply builtin functions to resources post transformation within the same kustomize dir. In #2099 I place the transformer in |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@pwittrock: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
kubebuilder alpha config-gen
support for non-default service accounts -- originally introduced in #2070From #2070 description: