Skip to content

Conversation

@nlamirault
Copy link
Contributor

@nlamirault nlamirault commented Feb 7, 2025

Description

Setup Kubernetes recommended labels for all resources

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Summary by CodeRabbit

  • New Features
    • Added standard Kubernetes labels to OpenFGA resources for improved identification and management.
    • Role and RoleBinding resources now include consistent metadata labels.
  • Refactor
    • Consolidated label application in deployment templates for streamlined configuration.

Signed-off-by: Nicolas Lamirault <[email protected]>
Signed-off-by: Nicolas Lamirault <[email protected]>
@nlamirault nlamirault requested review from a team as code owners February 7, 2025 13:43
@coderabbitai
Copy link

coderabbitai bot commented Jun 20, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes update Helm chart templates for OpenFGA by enhancing label management. Two standard Kubernetes labels are added to the common labels template. Label inclusion in the deployment template is consolidated, and labels are now added to Role and RoleBinding resources in the RBAC template. No logic or public interface changes occurred.

Changes

File(s) Change Summary
charts/openfga/templates/_helpers.tpl Added two Kubernetes standard labels (component, part-of) to the openfga.labels template.
charts/openfga/templates/deployment.yaml Consolidated pod metadata label inclusion to use only openfga.labels template.
charts/openfga/templates/rbac.yaml Added labels metadata to Role and RoleBinding using the openfga.labels template.

Sequence Diagram(s)

sequenceDiagram
    participant HelmChartUser
    participant HelmTemplates
    participant KubernetesAPI

    HelmChartUser->>HelmTemplates: Install/Upgrade OpenFGA chart
    HelmTemplates->>HelmTemplates: Generate resources with openfga.labels (includes new standard labels)
    HelmTemplates->>KubernetesAPI: Deploy resources (Deployment, Role, RoleBinding) with consolidated labels
    KubernetesAPI-->>HelmChartUser: Resources created with updated labels
Loading
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
charts/openfga/templates/_helpers.tpl (2)

50-50: Label addition: app.kubernetes.io/component
Added the standard component label with a fixed value. Consider quoting static strings (e.g. "authorization-controller") for YAML consistency and to avoid parsing edge cases.


55-55: Label addition: app.kubernetes.io/part-of
Introduced the part-of label to tie resources back to the OpenFGA chart. Ensure this new label is documented in your chart’s README so users are aware of the automatically applied metadata.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7eb7ae5 and bd70868.

📒 Files selected for processing (3)
  • charts/openfga/templates/_helpers.tpl (1 hunks)
  • charts/openfga/templates/deployment.yaml (1 hunks)
  • charts/openfga/templates/rbac.yaml (2 hunks)
🔇 Additional comments (3)
charts/openfga/templates/rbac.yaml (2)

6-7: Apply consolidated labels to Role resource
The openfga.labels helper is correctly injected under metadata.labels with proper indentation (nindent 4). This ensures all standard and custom common labels propagate to Roles.


21-22: Apply consolidated labels to RoleBinding resource
Consistently applying openfga.labels to RoleBindings aligns with the rest of the chart. Indentation and scope look correct.

charts/openfga/templates/deployment.yaml (1)

28-28: Consolidate pod labels using openfga.labels
Replacing separate selector/common labels with a single openfga.labels inclusion simplifies maintenance. The nindent 8 is correct and podExtraLabels still applies as expected.

@rhamzeh rhamzeh merged commit b71ab41 into openfga:main Sep 23, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants