-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 fix: watch ipaddressclaim in openstackserver controller #2390
base: main
Are you sure you want to change the base?
🐛 fix: watch ipaddressclaim in openstackserver controller #2390
Conversation
|
Welcome @MisterKind! |
Hi @MisterKind. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
5519450
to
4373e72
Compare
/ok-to-test |
I think you'll need to run |
@@ -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{}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a copy paste from the openstackmachine controller but I wonder if we would want a predicate at some point, to ensure we trigger the create only when the FIP is created.
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need both for the OpenstackServer controller, here links to code where we fetch IPAddressClaims and IPAddresses
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/controllers/openstackserver_controller.go#L575
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/controllers/openstackserver_controller.go#L624
However, maybe the watch and RBAC are not needed anymore in the OpenstackMachine controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I'm not sure either and we have no CI coverage for that feature 😕 ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your first contribution, it's very appreciated. It touches an area where I'm not 100% comfortable (the FIP resource) with so I pinged Matt and Lennart. If you don't hear from us by mid next week, please let me know. I think it's an important bug to fix.
Also we'll need it backported.
/cherry-pick release-0.12 |
@EmilienM: once the present PR merges, I will cherry-pick it on top of In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
I already did it, but as the RBAC are the same as the OpenstackMachine controller, there no modifications. |
What this PR does / why we need it:
Add watch of IPAddressClaims in the OpenstackServer controller
Which issue(s) this PR fixes :
Fixes #2389
Special notes for your reviewer:
TODOs:
/hold