-
Notifications
You must be signed in to change notification settings - Fork 21
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
[NSXServiceAccount] Watch mgmt-proxy service and reconcile all NSXSA #1019
base: main
Are you sure you want to change the base?
[NSXServiceAccount] Watch mgmt-proxy service and reconcile all NSXSA #1019
Conversation
Thanks for the PR. Let me review it. |
Hi @edwardbadboy @gran-vmv @liu4480 |
pkg/controllers/nsxserviceaccount/nsxserviceaccount_controller.go
Outdated
Show resolved
Hide resolved
pkg/controllers/nsxserviceaccount/nsxserviceaccount_controller.go
Outdated
Show resolved
Hide resolved
pkg/controllers/nsxserviceaccount/nsxserviceaccount_controller.go
Outdated
Show resolved
Hide resolved
d2a15ab
to
b982484
Compare
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.
Overall LGTM. A small comment.
r.StatusUpdater.UpdateFail(ctx, obj, err, "", updateNSXServiceAccountStatuswithError) | ||
return ResultRequeue, err | ||
} | ||
r.StatusUpdater.UpdateSuccess(ctx, obj, updateNSXServiceAccountStatus) | ||
r.StatusUpdater.IncreaseDeleteSuccessTotal() |
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.
Could you ask @yanjunz97 for this? I think this may be a mistake.
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 think we can remove r.StatusUpdater.IncreaseDeleteSuccessTotal()
here.
@yanjunz97 could you please take a look as well ?
// Reconcile all NSXSA if existing Service with label "mgmt-proxy.antrea-nsx.vmware.com" is updated with Service LB VIP | ||
if oldObjHasLabel && newObjHasLabel { | ||
// Service type updated to LB | ||
if oldObj.Spec.Type != corev1.ServiceTypeLoadBalancer && newObj.Spec.Type == corev1.ServiceTypeLoadBalancer { |
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.
what if oldObj.Spec.Type != newObj.Spec.Type and both are not corev1.ServiceTypeLoadBalancer, will this be ignored, for example, service type has been changed from nodeport to clusterip
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.
Yes, it will be ignored.
Reconcile all NSXSA whenever LB VIP is updated for mgmt-proxy. For realized NSXSA, update proxyEndpoints only if it has changed. Signed-off-by: Kumar Atish <[email protected]>
b982484
to
d361378
Compare
Reconcile all existing NSXSA incase of following events of K8s service corresponding to mgmt-proxy.
While reconciling realized NSXSA, update proxyEndpoints if proxyEndpoints have changed.