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

Adapt to new apiVersion for controllers #638

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

zhengxiexie
Copy link
Contributor

@zhengxiexie zhengxiexie commented Jul 17, 2024

Since apiVersion nsx.vmware.com conflicts with other teams, this patch supports the new apiVersion: crd.nsx.vmware.com.
All vpc controllers will watch the new apiVersion, however, there is a special case, securitypolicy.
T1 mode securitypolicy has been released to the market, so we should check if the user is using T1, if yes, we should go on supporting it. The implementation behind it is to reuse the previous logic underlay, convert.go is to converse the structs of the new and the old between, in the securitypolicy controller, we check whether to watch the old or the latest.
On the NCP side, it will apply all the yamls in dir build/yaml/crd, besides, since we will go on supporting T1 mode, we must check vpc FSS, if it is vpc mode, then also apply the yaml in dir build/yaml/crd/t1/, or in dir build/yaml/crd/vpc/.

For VPC mode securitypolicy, it can be created successfully

image

So does T1 mode
image

New apiVersion also applies to other CRs.

@zhengxiexie zhengxiexie force-pushed the zhengxie/new_api_group branch from 39581d8 to 95c04e4 Compare July 17, 2024 06:19
@zhengxiexie zhengxiexie requested review from heypnus and dantingl July 17, 2024 06:24
@zhengxiexie zhengxiexie force-pushed the zhengxie/new_api_group branch 8 times, most recently from 07c25f8 to 0926f63 Compare July 18, 2024 03:18
@zhengxiexie zhengxiexie requested a review from timdengyun July 18, 2024 03:18
build/yaml/crd/crd.nsx.vmware.com_ippools.yaml Outdated Show resolved Hide resolved
pkg/apis/crd.nsx.vmware.com/v1alpha2/ippool_types.go Outdated Show resolved Hide resolved
build/yaml/crd/old/nsx.vmware.com_securitypolicies.yaml Outdated Show resolved Hide resolved
pkg/nsx/services/common/types.go Outdated Show resolved Hide resolved
pkg/nsx/services/common/types.go Outdated Show resolved Hide resolved
@timdengyun
Copy link
Contributor

squash two commits into one commit.

@zhengxiexie zhengxiexie changed the title Modify group name nsx.vmware.com with crd.nsx.vmware.com New crd.nsx.vmwre.com apiVersion controller +1 Jul 25, 2024
@zhengxiexie zhengxiexie force-pushed the zhengxie/new_api_group branch from 0926f63 to f292fd0 Compare July 29, 2024 08:53
@zhengxiexie zhengxiexie changed the title New crd.nsx.vmwre.com apiVersion controller +1 Adapt to new apiVersion for controllers Jul 29, 2024
@zhengxiexie zhengxiexie force-pushed the zhengxie/new_api_group branch 5 times, most recently from 3579ac1 to 3d38067 Compare July 29, 2024 09:23
cmd/main.go Show resolved Hide resolved
pkg/nsx/services/securitypolicy/convert.go Outdated Show resolved Hide resolved
@zhengxiexie zhengxiexie changed the title Adapt to new apiVersion for controllers Adapt to new apiVersion for controllers +1 Aug 1, 2024
@zhengxiexie zhengxiexie force-pushed the zhengxie/new_api_group branch 4 times, most recently from 8551fef to e1cc758 Compare August 2, 2024 02:55
@zhengxiexie zhengxiexie force-pushed the zhengxie/new_api_group branch 2 times, most recently from 232cd85 to fc35f87 Compare August 2, 2024 04:13
@zhengxiexie zhengxiexie force-pushed the zhengxie/new_api_group branch from fc35f87 to c3be49c Compare August 2, 2024 04:17
Copy link
Contributor

@dantingl dantingl left a comment

Choose a reason for hiding this comment

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

Please check in after local e2e test is done

cmd/main.go Show resolved Hide resolved
@zhengxiexie zhengxiexie changed the title Adapt to new apiVersion for controllers +1 Adapt to new apiVersion for controllers Aug 3, 2024
@zhengxiexie
Copy link
Contributor Author

/e2e

1 similar comment
@zhengxiexie
Copy link
Contributor Author

/e2e

@zhengxiexie zhengxiexie merged commit 6e7c54a into vmware-tanzu:main Aug 5, 2024
2 checks passed
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.

5 participants