-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
generate: consider service accounts when generating a CSV #3610
generate: consider service accounts when generating a CSV #3610
Conversation
internal/generate/clusterserviceversion/clusterserviceversion_updaters.go
Outdated
Show resolved
Hide resolved
internal/generate/clusterserviceversion/clusterserviceversion_updaters.go
Outdated
Show resolved
Hide resolved
8ae4709
to
2389149
Compare
f99bba0
to
452d972
Compare
The algorithm for writing permissions, as a result of discussion in #3610 (comment) and with @joelanford offline:
|
`generate <bundle|packagemanifests>` input. These objects will be written to the resulting bundle. For now, only Roles, RoleBindings, their Cluster equivalents, and ServiceAccounts are written. internal/cmd/operator-sdk/generate: write RBAC objects to stdout or files named with object.Name + GVK internal/generate/{collector/clusterserviceversion}: consider (cluster) role bindings so CSV generator can assign the correct service account names to roles
452d972
to
1adee98
Compare
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.
/lgtm
internal/generate/clusterserviceversion/clusterserviceversion_test.go
Outdated
Show resolved
Hide resolved
1adee98
to
5c7a47d
Compare
14ec7f9
to
b4ec8e4
Compare
@@ -8,10 +8,10 @@ metadata: | |||
"apiVersion": "cache.example.com/v1alpha1", |
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.
These testdata changes can be refactored into another PR, they're not directly related to the bugfix.
b4ec8e4
to
8aebd0c
Compare
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.
/lgtm
The bundle generated by operator-sdk v0.17.0 contains incorrect cluster permission service account name. This issue is fixed in v0.19.0. Patch using yq with the correct value. Refer: operator-framework/operator-sdk#3610 Processing the CSV file via yq changes the indentations, resulting in unrelated changes to the file.
The bundle generated by operator-sdk v0.17.0 contains incorrect cluster permission service account name. This issue is fixed in v0.19.0. Patch using yq with the correct value. Refer: operator-framework/operator-sdk#3610 Processing the CSV file via yq changes the indentations, resulting in unrelated changes to the file.
Description of the change:
--update-crds
to--update-objects
Motivation for the change: This PR adds handling for extra RBAC objects present in
generate <bundle|packagemanifests>
input. These objects will be written to the resulting bundle. For now, only Roles, RoleBindings, their Cluster equivalents, and ServiceAccounts are written.This PR also correctly names service account for (cluster) role permissions. These are currently incorrect because the CSV generator is naively using (cluster) role names instead of actual service account names. Previously this was ok because the names match the service account, but this is no longer the case. See #3600.
Old test data has been removed, and a static
basic.operator.yaml
containing the output ofkustomize build config/manifests
added; the static file's contents match a current project manifest build.Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments
(seechangelog/fragments/00-template.yaml
)website/content/en/docs