Skip to content
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

Merged
merged 4 commits into from
Nov 27, 2020
Merged

Conversation

lobkovilya
Copy link
Contributor

Signed-off-by: Ilya Lobkov [email protected]

Summary

IPAM has to be synced between Kuma CP restarts. This PR fixes it

@lobkovilya lobkovilya requested a review from a team as a code owner November 25, 2020 12:23
}

func IsAddressAlreadyAllocated(err error) bool {
return err != nil && strings.HasPrefix(err.Error(), "Address already allocated")
Copy link
Contributor

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.

Copy link
Contributor Author

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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#CreateOrUpdateVIPConfigby reacting on changes in the cluster.

@lobkovilya lobkovilya merged commit 7d745d5 into master Nov 27, 2020
@lobkovilya lobkovilya deleted the fix/resync-ipam branch November 27, 2020 14:08
mergify bot pushed a commit that referenced this pull request Nov 27, 2020
(cherry picked from commit 7d745d5)

# Conflicts:
#	pkg/dns/vips_allocator.go
nickolaev pushed a commit that referenced this pull request Dec 1, 2020
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants