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 type issue of ippool #367

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

zhengxiexie
Copy link
Contributor

@zhengxiexie zhengxiexie commented Oct 24, 2023

Move the logic of deciding type of ippool before add and delete,
or else it would fail to delete ippool if user doesn't specify
type field.

@zhengxiexie zhengxiexie force-pushed the fix_ippool_type branch 2 times, most recently from 337b8bd to 077c397 Compare October 26, 2023 02:21
@wyike
Copy link

wyike commented Nov 8, 2023

Let' remove the change on CRD and API? They are not needed.

Move the logic of deciding type of ippool before add and delete,
or else it would fail to delete ippool if user doesn't specify
type field.
@zhengxiexie zhengxiexie requested review from TaoZou1 and removed request for dantingl and TaoZou1 November 8, 2023 03:22
@zhengxiexie zhengxiexie merged commit 5c9cb85 into vmware-tanzu:vpc_dev Nov 8, 2023
1 check passed
@@ -124,6 +124,17 @@ func (r *IPPoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr

// TODO: Xiaopei's suggestions: is there possibility that IPPool was deleted from nsx store but NSX block subnet was not deleted?

if obj.Spec.Type == "" {
Copy link

@wyike wyike Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the late awareness.

If spec.Type is set to a value at the beginning, I notice

			controllerutil.AddFinalizer(obj, servicecommon.IPPoolFinalizerName)
			if err := r.Client.Update(ctx, obj); err != nil {
				log.Error(err, "add finalizer", "ippool", req.NamespacedName)
				updateFail(r, &ctx, obj, &err)
				return resultRequeue, err
}

there will be an add finalizer later.

Will it patch the Type to ippool object when updating finalizer? Is this behavior change also what you want? Have you tested the change locally first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants