-
Notifications
You must be signed in to change notification settings - Fork 337
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(kuma-cp) resync IPAM in case of Kuma CP restart #1213
Conversation
Signed-off-by: Ilya Lobkov <[email protected]>
} | ||
|
||
func IsAddressAlreadyAllocated(err error) bool { | ||
return err != nil && strings.HasPrefix(err.Error(), "Address already allocated") |
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.
Hmm, can we have a custom ErrorType and compare against it here? Checking string prefix is probably not the best.
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 already have the same approach in store.go
and here error comes from Nordix/simple-ipam
library. The only thing we can do is to check it against string literal.
@@ -41,6 +41,10 @@ func (r *ConfigMapReconciler) Reconcile(req kube_ctrl.Request) (kube_ctrl.Result | |||
return kube_ctrl.Result{}, nil | |||
} | |||
|
|||
if err := r.VIPsAllocator.Sync(); err != nil { |
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.
Hmm, why is this one here?
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.
VIPsAllocator#Start
is called only on Universal. On Kubernetes we call VIPsAllocator#CreateOrUpdateVIPConfig
by reacting on changes in the cluster.
Signed-off-by: Ilya Lobkov <[email protected]>
Signed-off-by: Ilya Lobkov <[email protected]>
Signed-off-by: Ilya Lobkov <[email protected]> # Conflicts: # pkg/dns/vips_allocator.go
(cherry picked from commit 7d745d5) # Conflicts: # pkg/dns/vips_allocator.go
* fix(kuma-cp) resync IPAM in case of Kuma CP restart (#1213) (cherry picked from commit 7d745d5) # Conflicts: # pkg/dns/vips_allocator.go * make check Signed-off-by: Ilya Lobkov <[email protected]> Co-authored-by: Ilya Lobkov <[email protected]>
Signed-off-by: Ilya Lobkov [email protected]
Summary
IPAM has to be synced between Kuma CP restarts. This PR fixes it