Skip to content

Commit

Permalink
fix: watch ipaddressclaim in openstackserver controller
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterKind committed Jan 23, 2025
1 parent d741f26 commit 4373e72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/openstackserver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ type OpenStackServerReconciler struct {

// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=openstackservers,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=openstackservers/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddressclaims;ipaddressclaims/status,verbs=get;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddresses;ipaddresses/status,verbs=get;list;watch
// +kubebuilder:rbac:groups=openstack.k-orc.cloud,resources=images,verbs=get;list;watch

func (r *OpenStackServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, reterr error) {
Expand Down Expand Up @@ -214,6 +216,10 @@ func (r *OpenStackServerReconciler) SetupWithManager(ctx context.Context, mgr ct
}),
builder.WithPredicates(predicates.NewBecameAvailable(mgr.GetLogger(), &orcv1alpha1.Image{})),
).
Watches(
&ipamv1.IPAddressClaim{},
handler.EnqueueRequestForOwner(mgr.GetScheme(), mgr.GetRESTMapper(), &infrav1alpha1.OpenStackServer{}),
).
Complete(r)
}

Expand Down

0 comments on commit 4373e72

Please sign in to comment.