feat(projects): support contributor registry for default project role rules#6034
Open
EronWright wants to merge 1 commit intomainfrom
Open
feat(projects): support contributor registry for default project role rules#6034EronWright wants to merge 1 commit intomainfrom
EronWright wants to merge 1 commit intomainfrom
Conversation
… rules Add a `RoleRulesContributorRegistry` to the project reconciler that allows downstream distributions (e.g. Kargo EE) to inject additional PolicyRules into the default project roles (kargo-admin, kargo-viewer, kargo-promoter) at startup time, without needing to modify the core reconciler. The registry uses the existing `pkg/component.PredicateBasedRegistry` pattern. To support "apply all matching" semantics (vs. the existing "find first" semantics), a `GetAll()` method is added to the `PredicateBasedRegistry` interface and `listBasedRegistry` implementation. Callers register a `RoleRulesContributorRegistration` before calling `SetupReconcilerWithManager`. The reconciler applies all matching contributors when creating default roles for a new project. Part of: akuityio/kargo-enterprise#460 Signed-off-by: Eron Wright <eron.wright@akuity.io>
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6034 +/- ##
==========================================
+ Coverage 57.03% 57.07% +0.03%
==========================================
Files 463 464 +1
Lines 39112 39135 +23
==========================================
+ Hits 22309 22335 +26
+ Misses 15474 15472 -2
+ Partials 1329 1328 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetAll()to thePredicateBasedRegistryinterface (andlistBasedRegistryimplementation) inpkg/component, enabling "apply all matching" semantics in addition to the existing "find first" semantics.RoleRulesContributorRegistrationregistry inpkg/controller/management/projectsthat allows callers to inject additionalPolicyRules into the default project roles (kargo-admin,kargo-viewer,kargo-promoter) at startup time.ensureDefaultUserRolesfunction applies all registered contributors when creating default roles for a new project.Companion EE PR: akuityio/kargo-enterprise#460
Test plan
GetAll()inpkg/component/list_based_registry_test.gopkg/controller/management/projects/projects_test.go