Skip to content

Declare configmaps RBAC in the controllers watching the TLS profile - #1321

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
fmount:tlsprofile
Nov 24, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
fmount:tlsprofile

Conversation

@fmount

@fmount fmount commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

The NovaAPI, NovaMetadata and CyborgAPI controllers watch the well-known template-defaults ConfigMap, but only placement declared the configmaps permission, so the other three relied on the union of markers across the operator.
If the placement grant is ever narrowed or removed, those watches silently lose access. Declare get/list/watch in each controller that uses the watch: get for the template defaults read, list and watch for the informer.
Note that the generated role is unchanged, as controller-gen unions the verbs with the existing rule.

Jira: https://redhat.atlassian.net/browse/OSPRH-41044

The NovaAPI, NovaMetadata and CyborgAPI controllers watch the well-known
template-defaults ConfigMap, but only placement/api_controller.go
declared the configmaps permission, so the other three relied on the
union of markers across the operator. If the placement grant is ever
narrowed or removed, those watches silently lose access.
Declare get/list/watch in each controller that uses the watch: get for
the template defaults read, list and watch for the informer. The
generated role is unchanged, as controller-gen unions the verbs with the
existing rule.

Signed-off-by: Francesco Pantano <fpantano@redhat.com>
@fmount
fmount requested a review from stuggi November 23, 2026 10:07
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • NovaAPI now responds to changes in the default-template configuration, so updated settings can be reflected through reconciliation. CyborgAPI and Nova metadata controllers also have access to read and monitor ConfigMaps; these permission changes do not introduce a directly visible interface change.

The CyborgAPI, NovaAPI, and Nova metadata controllers gained core ConfigMap RBAC permissions. NovaAPI also gained a ConfigMap watch configured with WatchDefaultTemplateConfigMap.

Changes: Controller ConfigMap access

Layer / File(s) Summary
ConfigMap permissions and NovaAPI watch
internal/controller/cyborg/cyborgapi_controller.go, internal/controller/nova/novaapi_controller.go, internal/controller/nova/novametadata_controller.go
The controllers declare get, list, and watch access to core ConfigMaps. NovaAPI watches ConfigMaps with WatchDefaultTemplateConfigMap.

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

Change: Refactor

Suggested reviewers: stuggi

Merge Risk: Minimal · up to a7794

This change declares ConfigMap read and watch permissions for the Nova and Cyborg API controllers so they no longer depend on another controller's RBAC marker. NovaAPI also reconciles when the default-template ConfigMap changes. The generated role is unchanged, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the controllers now declare ConfigMap RBAC permissions for the TLS profile watch. The changeset adds get/list/watch configmaps markers to the CyborgAPI, NovaAPI and N…
Description check Passed The description explains the motivation and the change. It names the three controllers, states that only placement declared the configmaps permission, and lists the verbs (get for the template default…
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.
Full details: Title check

Explanation

The title states the main change: the controllers now declare ConfigMap RBAC permissions for the TLS profile watch. The changeset adds get/list/watch configmaps markers to the CyborgAPI, NovaAPI and NovaMetadata controllers. The title refers to the TLS profile, but the raw summary describes the watch as the template-defaults ConfigMap, so the title is only partially accurate about the watched resource.

Full details: Description check

Explanation

The description explains the motivation and the change. It names the three controllers, states that only placement declared the configmaps permission, and lists the verbs (get for the template defaults read, list and watch for the informer). It also notes the generated role is unchanged. It is related to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b9994f2c-44d1-4a01-b271-a5bf92ae8c7d
Commits

Reviewing files that changed from the base of the PR and between 8f38c21 and a7794b9.

Files selected for processing: 3

  • internal/controller/cyborg/cyborgapi_controller.go
  • internal/controller/nova/novaapi_controller.go
  • internal/controller/nova/novametadata_controller.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@stuggi stuggi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci

openshift-ci Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fmount, stuggi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/4d50b5f3d04d496abe0802fc2d1585c7

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 00m 16s
✔️ workloads-s2i-content-provider SUCCESS in 7h 23m 40s
✔️ nova-operator-kuttl SUCCESS in 52m 39s
✔️ nova-operator-kuttl-placement SUCCESS in 36m 01s
❌ nova-operator-tempest-multinode FAILURE in 2h 00m 38s
✔️ nova-operator-tempest-multinode-ceph SUCCESS in 2h 12m 57s
✔️ nova-operator-cyborg-tempest-multinode SUCCESS in 1h 30m 47s (non-voting)

Warning:
File .ssh/config found in build home directory during playbook github.com/openstack-k8s-operators/s2i-openstack-containers/playbooks/container-ci/zuul/pre.yaml for job workloads-s2i-content-provider. Add to preserve-home-paths if safe, or otherwise remove.

@stuggi

stuggi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build succeeded (check pipeline).
https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/f23b5c79bc9f48a99d02ec67de6f3929

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 44m 27s
✔️ workloads-s2i-content-provider SUCCESS in 4h 17m 42s
✔️ nova-operator-kuttl SUCCESS in 50m 39s
✔️ nova-operator-kuttl-placement SUCCESS in 35m 12s
✔️ nova-operator-tempest-multinode SUCCESS in 1h 57m 12s
✔️ nova-operator-tempest-multinode-ceph SUCCESS in 2h 19m 45s
✔️ nova-operator-cyborg-tempest-multinode SUCCESS in 1h 29m 51s (non-voting)

Warning:
File .ssh/config found in build home directory during playbook github.com/openstack-k8s-operators/s2i-openstack-containers/playbooks/container-ci/zuul/pre.yaml for job workloads-s2i-content-provider. Add to preserve-home-paths if safe, or otherwise remove.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 69a3926 into openstack-k8s-operators:main Nov 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants