Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Create/Update ClusterRoles just once? #19

@joelanford

Description

@joelanford

If I understand the existing code correctly, it looks like we currently call ensureClusterRoles in a loop for each scope template that references the scope template we're reconciling.

https://github.com/awgreene/oria-operator/blob/9594791bb669df7572f353346ffd85ee0460bfc7/controllers/scopetemplate_controller.go#L96-L100

This will cause a bunch of unnecessary chatter with the API server because we'll end up sending a bunch of redundant update calls after the first one.

Instead, perhaps we should call ensureClusterRoles once behind a check for len(scopeInstancesThatReferenceScopeTemplate) > 0?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions