Skip to content

feat: support setting metadata.annotations - #281

Open
porridge wants to merge 1 commit into
mainfrom
porridge/annotations
Open

feat: support setting metadata.annotations#281
porridge wants to merge 1 commit into
mainfrom
porridge/annotations

Conversation

@porridge

@porridge porridge commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Needed for https://redhat.atlassian.net/browse/ROX-36583 which sets platform.stackrox.io/managed-services: true.

I only added annotations for now, as overriding all of metadata could lead to "creative" but fragile uses.

Tested in another PR.

Summary by CodeRabbit

  • New Features
    • Central and SecuredCluster configurations now support optional metadata annotations.
    • Custom resources created from these configurations include the specified annotations, enabling additional metadata to be attached to deployed resources.
    • Annotation values are merged with existing resource metadata while preserving current configuration behavior.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Enterprise

Run ID: 9c1660d3-ec65-4d01-90c3-ee568acfb157

📥 Commits

Reviewing files that changed from the base of the PR and between d7bdfdd and 0d1c22a.

📒 Files selected for processing (1)
  • internal/deployer/config.go

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The change adds optional metadata annotations to Central and SecuredCluster configuration. Their custom-resource builders merge these annotations into resource metadata and report annotation merge errors.

Changes

Metadata annotations

Layer / File(s) Summary
Configuration and custom-resource metadata
internal/deployer/config.go
CentralConfig and SecuredClusterConfig now accept optional MetadataAnnotations. Their custom-resource builders merge the annotations into resource metadata and update merge error messages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 0d1c2

This change adds optional metadata annotations to Central and SecuredCluster custom resources without introducing a general metadata override. No current merge-readiness risk remains.

Suggested reviewers: mclasmeier

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: support for setting metadata annotations.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch porridge/annotations

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

DeployTimeout time.Duration `yaml:"deployTimeout,omitempty"`
PortForwarding *bool `yaml:"portForwarding,omitempty"`
EarlyReadiness *bool `yaml:"earlyReadiness,omitempty"`
MetadataAnnotations map[string]string `yaml:"metadataAnnotations,omitempty"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

wondering about potential related use-cases in the future -- should we maybe
make this a nested central.metadata.annotations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It crossed my mind, but I'm wondering if existence of central.metadata might make people incorrectly think anything in there is settable? 🤔

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not saying that we have to do it this way, but I believe that this is something that should be coverable by docs and if people make wrong assumptions based on that... well. 🤷

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