Skip to content

Create service accounts strictly after roles.#2574

Merged
knative-prow-robot merged 2 commits into
knative:masterfrom
Cynocracy:order-matters-now
Feb 18, 2020
Merged

Create service accounts strictly after roles.#2574
knative-prow-robot merged 2 commits into
knative:masterfrom
Cynocracy:order-matters-now

Conversation

@Cynocracy
Copy link
Copy Markdown
Contributor

This is necessary when the installer of the eventing
YAML does not have bind on all roles in the cluster.
I've been prototyping an RBAC restriction that would
grant escalate on all roles but not bind on all
roles in the Operator RBAC. That adds some guard-rails
that are currently missing, but requires this particular
ordering to be correct.

Proposed Changes

  • Create source-observer role before a binding referencing it.

Release Note

  • 🧽 Create source-observer role before a binding referencing it.

This is necessary when the installer of the eventing
YAML does not have `bind` on all roles in the cluster.
I've been prototyping an RBAC restriction that would
grant `escalate` on all roles but not `bind` on all
roles in the Operator RBAC. That adds some guard-rails
that are currently missing, but requires this particular
ordering to be correct.
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 14, 2020
@knative-prow-robot knative-prow-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 14, 2020
@Cynocracy
Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@Cynocracy
Copy link
Copy Markdown
Contributor Author

/retest

@yolocs
Copy link
Copy Markdown
Contributor

yolocs commented Feb 14, 2020

Is there an issue we can reference for more context?

@Cynocracy
Copy link
Copy Markdown
Contributor Author

Yes, this is in reference to

knative/eventing-operator#106

and

knative/serving-operator#282

While limiting the permissions the Operator has, I discovered that today it required the ability to bind a non-existent role due to the incorrect ordering here between
config/200-source-observer-clusterrole.yaml
and
config/200-eventing-serviceaccount.yaml

@Cynocracy Cynocracy changed the title Create the source-observer role before a binding. Create service accounts strictly after roles. Feb 14, 2020
@Cynocracy
Copy link
Copy Markdown
Contributor Author

Updated in light of the other SA creation having the same issue :)

This now creates both SAs after the roles that they need.

@Cynocracy
Copy link
Copy Markdown
Contributor Author

You can also see knative/eventing-operator#109 for what this enables.

@n3wscott
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cynocracy, n3wscott

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

The pull request process is described here

Details 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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2020
@knative-prow-robot knative-prow-robot merged commit e26ca3e into knative:master Feb 18, 2020
@Cynocracy
Copy link
Copy Markdown
Contributor Author

Thanks!

@Cynocracy Cynocracy deleted the order-matters-now branch February 18, 2020 18:38
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants