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 bug, could delete subnetset when there are still stale subnetport… #636

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zhengxiexie
Copy link
Contributor

@zhengxiexie zhengxiexie commented Jul 12, 2024

When there are stale subnetports in one subnet of subnetset, we should not allow deleting it.
Tests done:

apiVersion: nsx.vmware.com/v1alpha1
kind: SubnetPort
metadata:
  name: pod-59
  namespace: zx-test-2
spec:
  subnetSet: pod-default

create subnetport and delete pod-default, it will fail reporting

2024-07-15 03:30:04.994	INFO	subnetset/subnetset_controller.go:57	reconciling subnetset CR	{"subnetset": {"name":"pod-default","namespace":"zx-test-2"}}
2024-07-15 03:30:04.994	ERROR	subnetset/subnetset_controller.go:122	deletion failed, delete all the subnetports first	{"subnetset": {"name":"pod-default","namespace":"zx-test-2"}, "error": "stale subnet ports found while deleting subnetset zx-test-2/pod-default"}
2024-07-15 03:30:05.034	INFO	subnetset/subnetset_controller.go:204	updated SubnetSet	{"Name": "pod-default", "Namespace": "zx-test-2", "New Conditions": [{"type":"Ready","status":"False","lastTransitionTime":"2024-07-15T03:30:04Z","reason":"SubnetNotReady","message":"stale subnet ports found while deleting subnetset zx-test-2/pod-default"}]}
2024-07-15 03:30:05.034	DEBUG	recorder/recorder.go:104	stale subnet ports found while deleting subnetset zx-test-2/pod-default	{"type": "Warning", "object": {"kind":"SubnetSet","namespace":"zx-test-2","name":"pod-default","uid":"779fb1b6-50c5-49cf-b870-04e6ea6f13c7","apiVersion":"nsx.vmware.com/v1alpha1","resourceVersion":"1897779"}, "reason": "FailUpdate"}

delete vm-default will succeed since it has no port attached in it.

…s left

When there are stale subnetports in one subnet of subnetset, we should not allow
deleting it.

Signed-off-by: Xie Zheng <xizheng@vmware.com>
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.

None yet

2 participants