Skip to content

Commit 8029852

Browse files
lmicciniclaude
andcommitted
Add RBAC annotation for Services to InstanceHA controller
The controller creates a metrics Service but was missing the kubebuilder RBAC marker for core/services. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6227cb3 commit 8029852

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

internal/controller/instanceha/instanceha_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func (r *Reconciler) GetLogger(ctx context.Context) logr.Logger {
8181
// +kubebuilder:rbac:groups=instanceha.openstack.org,resources=instancehas/finalizers,verbs=update;patch
8282
// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;
8383
// +kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch;
84+
// +kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete
8485
// +kubebuilder:rbac:groups=k8s.cni.cncf.io,resources=network-attachment-definitions,verbs=get;list;watch
8586
// service account, role, rolebinding
8687
// +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;list;watch;create;update;patch

test/functional/instanceha_controller_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
. "github.com/onsi/gomega" //revive:disable:dot-imports
2222

2323
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
24+
//revive:disable-next-line:dot-imports
2425
. "github.com/openstack-k8s-operators/lib-common/modules/common/test/helpers"
2526
corev1 "k8s.io/api/core/v1"
2627
"k8s.io/apimachinery/pkg/types"
@@ -63,7 +64,7 @@ var _ = Describe("InstanceHa Controller", func() {
6364
DeferCleanup(k8sClient.Delete, ctx, th.CreateConfigMap(types.NamespacedName{
6465
Name: "openstack-config",
6566
Namespace: namespace,
66-
}, map[string]interface{}{
67+
}, map[string]any{
6768
"clouds.yaml": "test-data",
6869
}))
6970

@@ -141,7 +142,7 @@ var _ = Describe("InstanceHa Controller", func() {
141142
DeferCleanup(k8sClient.Delete, ctx, th.CreateConfigMap(types.NamespacedName{
142143
Name: "openstack-config",
143144
Namespace: namespace,
144-
}, map[string]interface{}{
145+
}, map[string]any{
145146
"clouds.yaml": "test-data",
146147
}))
147148

0 commit comments

Comments
 (0)