Skip to content
This repository was archived by the owner on Jun 21, 2026. It is now read-only.
This repository was archived by the owner on Jun 21, 2026. It is now read-only.

Add a function for generating RBAC Resources for an operator from an OperatorConfig #1

Description

@psFried

Writing correct RBAC resources is tedious and error prone, and there's basically no reason to do it by hand. What I've been thinking of is adding an API for generating RBAC resources from an OperatorConfig (and possibly some other inputs). This could be used in a few different ways. One option would be something like the following quick sketch:

fn main() {
    let operator_config = create_operator_config();
    if std::env::args().any(|arg| arg == "--print-rbac-role") {
        let rbac_roles = generate_rbac_cluster_role(&operator_config);
        println!("{}", rbac_roles);
    } else {
        // do the usual to run the operator
    }
}

I think the bare minimum functionality that would be useful would be to only generate a ClusterRole as a yaml or json string from the OperatorConfig. A more complete feature set might allow the option to generate either a Role or ClusterRole (or maybe base that on the presence of a namespace in the config), allow for choice of format, or have additional options to generate Users and (Cluster)RoleBindings based on some additional input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussion neededWe need to understand the requirements and/or use cases better before implementationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions